• 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 php artisan serve to mimic HTTPS

Multiply each value in array using array_map function

What will the best solution for this multiple optional filter?

Yii2: How to download backup files using spanjeta/yii2-backup?

Doctrine 2 mapping referencing unique key

Submitting a form with ajax in Wordpress

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

Is it possible to change the table name in the migration file-laravel

Laravel - How to properly generate unique slugs from article titles?

Target Individual Form Instance/Counter Inside A PHP While Loop

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

What is the function of the (new Date()).getTime() in PHP?

Can I use a WooCommerce function without any WooCommerce page?

Wordpress 'post_type_link' hides permalink

how to loop through json response data using ajax jquery?

About Contact Privacy policy Terms and conditions