PDA

View Full Version : flash5 and php: passing variables around...


djungle
08-04-2004, 06:48 AM
Hi,
I'm having trouble sending variables back and forth from flash5 to php4
I am using this lil' contact form to test things out.
on (release) {
if (!Name.length) {
EmailStatus = "Please enter your name";
} else {
this.loadVariables("contact.php", 0, "POST");
EmailStatus = "Sending...please wait";
}
}
Since I was recieving blank emails, I changed the php code so that it just returns the variables recieved from flash.
<?php
$Name = $HTTP_POST_VARS["Name"];
Print "_root.Mail.EmailStatus=$Name";
?>
But its not returning anything...

Anyone know why or what's going on? :confused:

CyanBlue
08-10-2004, 03:38 AM
Two things...

Print "_root.Mail.EmailStatus=$Name";

That line won't make much sense to Flash...
Instead, use something like this...

Print "EmailStatus=$Name";

In other words, there is no need to provide the full path from the PHP because it doesn't make any sense to Flash...

Second...

this.loadVariables("contact.php", 0, "POST");
EmailStatus = "Sending...please wait";

You are expecting some variable back from the PHP from the first line, right???
AND, you are displaying 'please wait' message while you are expecting something back from the PHP...

There is onething that's missing in that line... You need some sort of 'loop' that will WAIT untile the data is received from the PHP... In F5, we used to call it 'swonking'...

Do some searching on the forum with that term and I am sure you will find plenty information... :)