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 ?