• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to get AJAX to post on second page?

javascriptphpjqueryajax


PHP Snippet 1:

$( document ).ready(function() {

$("button").click(function() {
var dataPoint = "chunk of data";
    ///////// AJAX //////// AJAX //////////
        $.ajax({
            type: 'POST',
            url:  'some_page_name.php',
            data: {dataPoint:dataPoint},
            success: function( response ){
                $('#success').html("Sent!!");
            }
        });
    ///////// AJAX //////// AJAX /////////

  });

PHP Snippet 2:

<button>Click me</button>
<div id="success"></div>

Related Snippets

Laravel multi auth - Authentication user provider [] is not defined

Where do I need to place a hook for phpunit?

Sentry on Symfony: how to exclude `NotFoundHttpException`

How can i call a function that executes an fpdf based on the choice of a form selector?

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

Magento 2 - How to add new block to admin panel in product page?

PHPExcel export HTML table to xlsx

Best way to scrolldown onpageload

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Pagekite error: FAIL: localhost:8080 is down

yii2 and mssql insert varbinary into model

XAMPP/SQLSRV: Unable to find Sqlsrv in PHPINFO(); - errors coming from connection

Dynamic table in HTML using MySQL and php

how to remove white space in select 2

About Contact Privacy policy Terms and conditions