• 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

cakephp save drag and drop list order to database

Creating command to backup MySql database in Laravel

How to make a array inside array?

Adding reCAPTCHA v2 into my PHP file

Check for PDO Results, If None Display Message, If Yes then Loop Through

Magento 2 - How to add new block to admin panel in product page?

Undefined variable in Laravel 8 project (php 7.4)

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

Yii2: How do I debug console commands?

Laravel Multi-language routes without prefix

Debugging Stripe Webhook Event

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Update Total in checkout of Woocommerce with Ajax Request

How to install PHP composer inside a docker container

Center point of multiple gps coordinates with php

About Contact Privacy policy Terms and conditions