(help!) PHP email bug through flash

Hi all,

Im trying to send an email from a swf using PHP. The data is received from dynamic text boxes in the swf with variable names:

_global.Email
_global.FirstName
ToCharity
Company

the php code recognises the “$ToCharity” and “$Company” correctly, but for the other two it prints the following instead of the actual textbox content: “Email” and “FirstName”

Im not a rocket scientist but my gut feeling tells me it has something to do with the “_global” part. Is there something to work around this?

This would be my actionscript (2.0):


//attached onto a button
on (release) {
        _root.slash_snd.start(0, 1);
        loadVariablesNum ("donateMailPHP.php", "0", "Post");
        EmailStatus = "Sending... one Moment Please...";
        gotoAndStop(356);
}

And this is my PHP:


<?
$from = "Blaa";
$ToEmail = "blaa@gmail.com";
##$ToName = "Blaa person";
$ToSubject = "Blaa Donation";

$EmailBody = "The following data displays details:

Donator's Name: $_global.FirstName
Donator's Company: $Company;
Donator's Email: $_global.Email
Chosen Charity: $ToCharity

";

$EmailFooter="Thank You";
$Message = $EmailBody.$EmailFooter;

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$from." <".$_global.Email.">");

Print "_root.EmailStatus=Complete - Your details have been sent to us";
?>


After trying this, the result was that the variables “$_POST[‘Email’]” and “$_POST[‘FirstName’]” were left blank.

This is my adjusted the code:


 <?
$FirstName = $_POST['_global.FirstName'];
$Email = $_POST['_global.Email'];
 $Company = $_POST['_global.Company'];

$from = "$FirstName";
$ToEmail = "blaa@gmail.com";
##$ToName = "Blaa person";
$ToSubject = "Blaa Donation";

$EmailBody = "The following data displays details:

Donator's Name: $FirstName
Donator's Company: $Company;
Donator's Email: $Email

";

$EmailFooter="Thank You";
$Message = $EmailBody.$EmailFooter;

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$from." <".$Email.">");

Print "_root.EmailStatus=Complete - Your details have been sent to us";
?> 

Where should these variables be shown, in the swf?

What’s happening now is that the email is sending the same message - blank variables, but the “_root.EmailStatus” in the swf does not show any response.

It maintains a previous text entry of “Sending… one Moment Please…”.