• 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

Live search query using JS and PHP for QA forum

Generate random username based on full name php

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

Using PHP to connect to a remote MSSQL database

How to validate Envato Purchase Code in PHP

merging two arrays with specified index

Currently Using CodeIgniter Framework i have an Error

How to show a popup modal in codeIgniter?

Reducing authentication calls on external API (Laravel 5.6)

How to find phpcs current default standard

Mysqli multi query error

How to Make Laravel Eloquent "IN" Query?

Form Validation and Submission to database

Find out the name of the last script that included the current one

PHP: Insert marker every 3 iterations

About Contact Privacy policy Terms and conditions