How to properly send $ .get from js to php and back There is a code
var test = 'asd'; $.get("ajax.php", {test:test}, function(data){ $('#content').html(data); } ); php
$test = $_POST['test']; echo $test; The answer does not come
How to properly send $ .get from js to php and back There is a code
var test = 'asd'; $.get("ajax.php", {test:test}, function(data){ $('#content').html(data); } ); php
$test = $_POST['test']; echo $test; The answer does not come
Everything is very simple. You send a GET request, and in a PHP script you expect to receive a POST.
Replace $_POST['test'] with $_GET['test'] and everything should work.
Source: https://ru.stackoverflow.com/questions/615485/
All Articles