• 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

Star and Half Star Rating in Laravel

Malformed MIME header error in Symfony 5.3

Elastic Beanstalk with Laravel Envoy

Laravel relationship belongsToMany with composite primary keys

how to get value from array in laravel

How can I make Laravel return a custom error for a JSON REST API

jQuery Ajax Post with data

Display a product custom field only in WooCommerce Admin single orders

PHPUnit (Phar) Fatal Error Only When Test Fails

Best way to scrolldown onpageload

Creating live search with AJAX and CodeIgniter

How to insert data from multiple select dropdown values into database?

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

storagelogs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Post Form Data To phpmyadmin Database

About Contact Privacy policy Terms and conditions