Send mail with PHP, missing input text?
Please help, this can't be difficult to solve. I've created a simple Flash contact form that uses PHP. It functions, but the results in the delivered email do not include the text from the inputs fields in Flash. Also, it does not return a "From" or "Reply-to" value. (This is from a simple tutorial followed exactly, except with 3 added fields. It uses the "LoadVars" method in Actionscript.)
Here is the 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.thePhone = thePhone.text;
senderLoad.theBuilddate = theBuilddate.text;
senderLoad.theLot = theLot.text;
senderLoad.theMessage = theMessage.text;
senderLoad.sendAndLoad("http://betaclient2.ommvc.com/send.php",receiveLoad);
}
receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.gotoAndStop("success");
}
else {
_root.gotoAndStop("failed");
}
}
Here is the PHP page code:
<?PHP
$to = "dan.ommvc@comcast.net";
$subject = "Custom Home Inquiry";
$message = "Name: " . $theName;
$message .= "\nEmail: " . $theEmail;
$message .= "\nPhone: " . $thePhone;
$message .= "\nBuilddate: " . $theBuilddate;
$message .= "\nLot: " . $theLot;
$message .= "\n\nMessage: " . $theMessage;
$headers = "From: $theEmail";
$headers .= "\nReply-To: $theEmail";
$sentOk = mail($to,$subject,$message,$headers);
echo "sentOk=" . $sentOk;
?>
(Using Dreamweaver CS4, Flash CS4)
