Contact Form AS

{FLASH MX 2004}

Hi. Ok, I’m having issues with my flash based contact form that uses PHP. My site is set up with a main movie and each page is loaded into that main movie as external swf’s. The contact form loads in fine, it allows me to type my name, email, and message and then send. It even responds saying that the function worked and takes me to my success frame label. The email sends but when I open it up in my inbox none of the information is there. My labels are there from the PHP file but none of the information I entered into the form shows up.

However, when I reset the paths in the actionscript and just view the swf online directly (not loading it into the parent movie) it works just like above but I can see the information I entered into the contact form, in the email. it works perfectly. so somewhere my actionscript is wrong when it’s being loaded as an external swf.

My contact.swf actionscript is below between dashed lines.
sender=my send button instance name
background.container is the main movie. all swf’s load into container that lives within background.


ActionScript Code:
stop();

var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();

sender.onRelease = function() {
senderLoad.theName = theName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theMessage = theMessage.text;
senderLoad.sendAndLoad(“http://www.domain.com/email.php”,receiveLoad);
}

receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.background.container.send.gotoAndStop(“success”);
}
else {
_root.background.container.send.gotoAndStop(“failed”);
}
}

here is my PHP file although I’m pretty sure the problem is in the actionscript.


PHP Code:
<?PHP

$to = "kirk@domain.com";
$subject = “Website Contact”;
$message = "Name: " . $theName;
$message .= "
Email: " . $theEmail;
$message .= "

Message: " . $theMessage;
$headers = “From: $theEmail”;
$headers .= "
Reply-To: $theEmail";

$sentOk = mail($to,$subject,$message,$headers);

echo “sentOk=” . $sentOk;

?>

any help or suggestions would be much appreciated. thanks!!