is something being returned from your php file?
Well firebug shows the POST info to be:
And the response seems to be the entire source code of the html page??
create another loadvars instance and an onData handler to use as your receiving lv.
Hmm, I'm not entirely sure how to do that. But I think we have our wires crossed.
I'm not actually looking to return any data from the PHP file. I just want to pass the number to the PHP file without reloading the page.
My site is performing quiet slowly so I'm trying to remove this '500 Internal' error and generally improve the speed of the site's scripts.
Also, I'm not sure if the PHP file is cached after first being called? Basically this sendAndLoad() script gets executed every 10 seconds so I wasn't sure if every 10 seconds, the PHP file is reloaded?
Thanks for your replies.
1 person found this helpful
the php file will be loaded from cache unless you append a query string that prevents that. and you should be returning data from the php file so you're not calling the script before a previous call has completed.
Ok thanks for clearing that up! Sorry to be a pain... but can you give me an example of howto add another loadvars instance and an onData handler?
var sendLV:LoadVars = new LoadVars();
var receiveLV:LoadVars=new LoadVars();
// start your setTimeout() here to call your php repeatedly but this can really stuff a user's connection
sendLV.newNumber = _root.temp_number;
sendLV.sendAndLoad("updatenum.php?queryS="+Math.random(), receiveLV, "POST");
$num = $_POST['newNumber'];
//DATABASE STUFF HERE...
Thanks kglad, really appreciate the help! As always you save our skins :]