Skip to content

Instantly share code, notes, and snippets.

@jaffreyjoy
Last active August 24, 2019 03:44
Show Gist options
  • Save jaffreyjoy/c67bc472d0af82957ebd771293f1dbc2 to your computer and use it in GitHub Desktop.
Save jaffreyjoy/c67bc472d0af82957ebd771293f1dbc2 to your computer and use it in GitHub Desktop.
PHP <--> JS (data)
//send data to a php file using AJAX
$.ajax({
type: 'POST',
url: 'del_table.php',
data: {'variable': myval},
});
//get data from php variable
var myval = "<?php echo $date ?>";
//get js variable sent through AJAX
$date=$_POST['variable'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment