• 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

Filter array by skipping every nth element from the end

PHP SoapClient: set a namespace without prefix

How to insert data from multiple select dropdown values into database?

WordPress Security Standards want me to escape my html, but how to do it correctly?

Yii Ajax Submit button

How can I make Laravel return a custom error for a JSON REST API

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

Show Custom Data in Woocommerce Order Details Admin Area

Submitting a form with ajax in Wordpress

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Show only featured products in Woocommerce shop page

Eloquent insert id with sequence next value

How to submit a form when page loads using JavaScript?

How to get an Array value inside an object in an array Php [duplicate]

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

About Contact Privacy policy Terms and conditions