Accessing a variable passed by jquery using php
- by celenius
How does php access a variable passed by JQuery?
I have the following code:
$.post("getLatLong.php", { latitude: 500000},
function(data){
alert("Data Loaded: " + data);
});
but I don't understand how to access this value using php.
I've tried
$userLat=$_GET["latitude"];
and
$userLat=$_GET[latitude];
and then I try to print out the value (to check that it worked) using:
echo $userLat; but it does not return anything. I can't figure out how to access what is being passed to it.