• 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 sort by a custom appended relation to model

PHP if in_array() how to get the key as well?

Alert message after submitting form in PHP

ConstraintViolationListInterface to Exception in Symfony

php echo remove slashes from url [duplicate]

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

Yii Ajax Submit button

How to delete old images from public folder on update using Laravel

Add restriction to WooCommerce coupons by allowed user ID

Laravel display validation error

PHPUnit 7: Failed asserting that exception of type InvalidArgumentException is thrown

Laravel Pagination links() not working

Execute only one time and then wait set period of time before executing again

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

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

About Contact Privacy policy Terms and conditions