I am currently using a $.getJSON call that is working perfectly fine, as demonstrated below.
var jsonUrl = "http://www.somesite.co.uk/jsonusv.php?callback=?";
$.getJSON(jsonUrl,function(zippy){
...some code
}
However, I want to pass a variable along with it so that the PHP script can utilize its $_GET[''] value and customize the data.
I tried the following but couldn't get things to work. Any suggestions?
var jsonUrl = "http://www.somesite.co.uk/jsonusv.php?callback=?&value=65";
The PHP page looks somewhat like this after being stripped down. I attempted to retrieve the $_GET['value'], but it didn't function as expected.
<?PHP
header("content-type: application/json");
$theSqlquery = "SELECT * FROM table ORDER BY timestamp DESC LIMIT 20";
$result131 = mysql_query($theSqlquery);
if ($result131)
{
//compose Json string in $temp
echo $_GET['callback'] . '(' . $temp . ');';
}
?>