Send Variables In and Out PHP and Flash

Hi Guys,

Im a newbie here. I got a problem on how to send variable in and out within PHP and Flash. I tried to follow the tutorial posted in this website but it doesnt work (the tutorial used loadvarnum).

What I have done here is :

  • Flash page (called : tessend.html) send a variable (called : name) to php file (called : sendtoflash.php)
  • I put the code below in the tessend.html (mc_button_submit_vars is a button):

mc_button_submit_vars.onPress = function ()
{
getURL (“sendtoflash.php”, “_self”, “POST”);
};

  • In sendtoflash.php, I put :
    <?
    $dataForTxtbox_1 = “Tes”;
    print("&textbData1=$dataForTxtbox_1");
    echo “<script>”;
    echo “location = ‘mydata.html’”;
    echo “</script>”;
    ?>

  • PHP file then calls the flash file : mydata.html…the code inside mydata.html is

myData = new LoadVars();
myData.onLoad = function(){
placeTheDataIntoTheRightPlace();//call the function
};
myData.load(“http://localhost/sendtoflash.php”);
placeTheDataIntoTheRightPlace = function(){
txtBox1.text = myData.textbData1;
};

It does work well. But if I change the sendtoflash.php file into :
<?
$dataForTxtbox_1 = $_POST[‘name’];
print("&textbData1=$dataForTxtbox_1");
echo “<script>”;
echo “location = ‘mydata.html’”;
echo “</script>”;
?>

this doesnt work…

Is there anybody can help me? I posted this question in other forum but couldnt get a correct solution…