• 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

PHP DOTENV unable to load env vars

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

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

jQuery Ajax Post with data

PHP header location absolute URL

Reorder attribute dropdown terms in Woocommerce single variable products

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

how to hide previous markers when new markers added in google map javascript api

How can I get user id from session in javascript?

Update Total in checkout of Woocommerce with Ajax Request

Installing Composer - Internal Error

I want a way to give path to my files which are outside of public folder in laravel

Call to undefined function openssl_decrypt

Open a popup box after receiving result from ajax

About Contact Privacy policy Terms and conditions