I currently have a $.getJSON call which is working fine as shown below.
var jsonUrl = "http://www.somesite.co.uk/jsonusv.php?callback=?";
$.getJSON(jsonUrl,function(zippy){
...some code
}
However, I wish to pass a variable with it so that the PHP script can use its $_GET[''] value and tailor the data.
I tired the fooling but could not get things to work any ideas ?
var jsonUrl = "http://www.somesite.co.uk/jsonusv.php?callback=?&value=65";
The php page looks something like this this had been stripped down. I did try to detect the $_GET['value'] but it didn't work.
<?PHP
header("content-type: application/json");
$theSqlquery = "SELECT * FROM table ORDER BY timestamp DESC LIMIT 20";
$result131 = mysql_query($theSqlquery);
if ($result131)
{
//make up Json string in $temp
echo $_GET['callback'] . '(' . $temp . ');';
}
?>