• 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

how to use extended ASCII instead of unicode in PHP

PHP - CURL using HTTPS [closed]

Error converting docx to pdf using Unoconv

Refresh specific HTML content that retrieves data from MySQL

PHP to search within txt file and echo the whole line

PHP Discord OAUTH2 code sample not working

Multiply each value in array using array_map function

How to Create WooCommerce Subscription Product via. REST API?

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Get keys from associative array [duplicate]

Adding multiple items to WooCommerce cart at once

Creating live search with AJAX and CodeIgniter

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

PHP - Store information with NO database

Detect a fetch request in PHP

About Contact Privacy policy Terms and conditions