• 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 print last executed SQL query with Query log

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

How to execute sql code based on fetch array

Laravel Displaying image from database

Live search query using JS and PHP for QA forum

Refresh specific HTML content that retrieves data from MySQL

Shortcode or PHP inside a shortcode in Wordpress

Yii2 select2 database exception number of bound variables does not match number of tokens

Post Form Data To phpmyadmin Database

How to install LDAP in Docker php-fpm alpine

curl returning 301 error after migrating to https

How can I get new CSRF token in LARAVEL by using ajax

How to trim a video by 4 fragments to 4 seconds using the PHP-FFMpeg?

Laravel 5.1 Unknown database type enum requested

OAuth2 Token PHP

About Contact Privacy policy Terms and conditions