Hi,
I have the following actionscript that invokes a PHP script.
The PHP script is:
The PHP script works fine when I replace $_GET['limit'] with a hardcoded value. When I print out what is returned into varReceiverTitl es it is undefined.
Any ideas?
Sean
I have the following actionscript that invokes a PHP script.
Code:
var articlesToRetrieve = 5;
var currentIndex = 0;
varSenderTitles = new LoadVars();
varReceiverTitles = new LoadVars();
var limit = currentIndex + "," + articlesToRetrieve;
var url = "http://www.bemod.co.uk/scripts/GetNewsArticles.php?limit=" + limit;
//Send request.
varSenderTitles.sendAndLoad(url, varReceiverTitles, "GET");
//Retrieve the thread text.
varReceiverTitles.onLoad = function()
{
.....
}
Code:
$sql = "SELECT news_id, title FROM news ORDER BY title DESC LIMIT " . $_GET['limit'];
$result = $con->sqlExecute($sql);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$articles .= $row['news_id'] . '~' . $row['title'] . '|';
}
$articles = urlencode($articles);
Any ideas?
Sean