script to send Variables to PHP
There are two ways. Assuming you have a var called "myVar" and you are sending it to a PHP page called myphppage.php using POST,1) reccomended:
code:
var ldPHP=new LoadVars()
ldPHP.myVar="some value here"
ldPHP.onLoad=function(success){
if(success) {
trace("succesfully sent the varaible");
} else {
trace("failed to send the variable");
}
}
ldPHP.sendAndLoad("myphppage.php",ldPHP,"POST");
2)
code:
myVar="some value here"
loadVariables("myphppage.php",_root,"POST")
The LoadVars method is better as it tells you if the call has been succesful or not.In the PHP page, the variable can be accessed as if sent by a form submission
0 Comments:
Post a Comment
<< Home