POST becoming GET?

Hey everybody,

I’m having some problems using the send method of the LoadVars object. What I’m trying to do is send a variable to PHP which then ouputs it.

The problem is that I can get it to work using the GET method, but not using the POST method. Using the GET method I used this:


lv = new LoadVars();
lv.vari = "Variable sent via Flash";
lv.send("http://127.0.0.1/tut.php","_blank","GET");

And for the PHP I had:


<?
$receive = $_GET['vari'];
echo $receive;
?>

And it worked fine. But it used this URL that displayed the variable so I thought I’d use POST:


lv = new LoadVars();
lv.vari = "Variable sent via Flash";
lv.send("http://127.0.0.1/tut.php","_blank","POST");


<?
$receive = $_POST['vari'];
echo $receive;
?>

This doesn’t work. Also, Flash seems to be still using the GET method, because the url it uses is the same as before:

http://127.0.0.1/tut.php?vari=Variable%20sent%20via%20Flash

while the ?vari=… part shouldn’t even be there when using POST, should it ? What’s going wrong here ?

thats odd. I used that format for one of my websites and it works fine… can’t figure out any typos in ur script. Weird

Are you running it through the Flash IDE? did you try doing so from a browser? The player in Flash MX had a bug which sent variables through GET even when POST was specified

POST is used when executed from plug-in or ActiveX embedded in the browser. GET is used when executed from a projector, or the flash authoring environment. (This was for Flash 5. Flash MX always uses POST when you send the XML.)
[ LINK ]

I was using it from the CTRL+ENTER display. Is that the Flash IDE ? :stuck_out_tongue: I’ll try through a browser, thanks Ahmed, some usefull information there =)

yes, that IS the Flash IDE, or Integrated Development Env., or Program in other words :stuck_out_tongue:

Cool, didn’t know that, thanks for the info ahmed =)