sending value from flash as2 to php script
Hi,
I have posted before about the same issue but very probably not in the right way. I think I was running a old php version when those files worked for me and now I have read that the syntax has changed an so on...
All I want to do is try to understand php loading variables from flash from scratch.
I am basing on this tutorial example file where you send and receive only one variable.
the code in flash is as follows:
Code:
var myload:LoadVars = new LoadVars();
button.onRelease = function():Void
{
myload.myans = myans_txt.text;
myload.onLoad = function(checkAnswer:Boolean)
{
if (checkAnswer)
{
news.text = myload.ans;
}
};
myload.sendAndLoad("http://localhost/test.php",myload,"POST");
};
in the php side:
PHP Code:
<?phpif($_POST[string]){
$upper = strtoupper($_POST[string]);
echo "result=You just wrote $upper";
}
else{
echo "result=You did not write anything";
}
?>
this worked before I installed the newest version of WAMP with php 5.4.12. Is it deprecated perhaps? I would appreciate any help on beginning php. Not that I haven't googled, but I haven't been able to find a very simple updated example of sending variables in AS2
thanks