PHP code does not post client name in email...
Posted: Mon Oct 18, 2010 3:01 pm
Running this in conjunction with action script. I am receiving the email with the email address, and the message, but there is no client name coming through.
Need help!
Need help!
Code: Select all
<?php
//create short variable names
$clientName = $_POST['clientName'];
$email = $_POST['email'];
$message = $_POST['mess'];
//set up send mail
//enter you email address here
$sendMail = "m.fogarty@2b5.biz";
//enter your subject
$sub = "LSR Mailing List";
//this receives the message from the ActionScript
$inquiry = $message;
$extra = "From: $email\r\nReply-To: $email\r\n";
mail($sendMail,$sub,$inquiry,$extra);
//set up variable to let AS know that the mail was sent successfully
$wasSent = 1;
echo "&mailed=".$wasSent;
echo "&returnmsg=Thank you ".$clientName.". Your mail has been sent.";
?>
AC
stop();
//this ensures the input boxes are blank
emailForm_mc.clientName = "";
emailForm_mc.email = "";
emailForm_mc.message = "";
/*******************set up email form******************/
//set up function to make send button work
emailForm_mc.send_btn.onRelease = function() {
//trace("button works");
receiver = new LoadVars();
receiver.onLoad = function(success) {
//this picks up the vaiable sent from PHP that lets the action script know if the mail has been sent. If it has been sent the value returned is 1 and the form resets.
clearForm = receiver.mailed;
if (success) {
//trace("i have loaded");
emailForm_mc.returnline = receiver.returnmsg;
}
//this clears the form if the mail has been sent. It knows to clear because PHP returns 1 through the variable &mailed.
if (clearForm == 1) {
emailForm_mc.clientName = "";
emailForm_mc.email = "";
emailForm_mc.message = "";
}
};
sender = new LoadVars();
sender.clientName = emailForm_mc.clientName;
sender.email = emailForm_mc.email;
sender.mess = emailForm_mc.message;
sender.sendAndLoad("phpFlashEmailScript.php",receiver,"POST");
};