• 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

Override default Auth routes in Laravel 7

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

How to create laravel storage symbolic link for production or sub domain system?

httpd.conf on Windows: can't locate API model structure `php8_module`

Why does using salted hash on python and php give me different results?

PHP my timezone is no setting up in PHP.ini File in xampp

php curl requesting twice

How to change HTML structure inside WP <head>

Check if user online laravel

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

Warning file_get_contents () failed to open stream: HTTP request failed! HTTP/1.0 402 Payment Required

stay with the last 15 elements of an array [duplicate]

How can I create a Download Page with post php method?

protect my blog content

PHP's array_map including keys

About Contact Privacy policy Terms and conditions