HERE IS MY FLASH ACTION SCRIPT TO SEND EMAIL FOR FORM. PLEASE HELP ME TO FIND WHAT I AM DOING WRONG! :sigh:
send_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
if (theName.text == "" || theEmail.text == "")
{
theFeedback.text = "*Required.";
}
else
{
// Create a variable container
var allVars:URLVariables = new URLVariables();
allVars.box1 = box_1.text;
allVars.box2 = box_2.text;
allVars.box3 = box_3.text;
allVars.box4 = box_4.text;
allVars.box5 = box_5.text;
allVars.name = theName.text;
allVars.email = theEmail.text;
//Send info to url
var mailAddress:URLRequest = new URLRequest("http://www.paintedthetown.com/email.php");
mailAddress.data = allVars;
mailAddress.method = URLRequestMethod.POST;
sendToURL(mailAddress);
theFeedback.text = "Thank you :)";
box_1.text = "";
box_2.text = "";
box_3.text = "";
box_4.text = "";
box_5.text = "";
theName.text = "";
theEmail.text = "";
}
}
THIS SEEMS TO BE WORKING BECAUSE I RECEIVE EMAIL BUT IT IS EMPTY (without info)
HERES THE PHP CODE
<?php
//Shows where to send the email.
//Shows what the subject will be in the email.
$sendTo = "craig@paintedthetown.com";
$subject = "Flash Reply";
//Headers to show the information sent.
$headers = " 1: " . $POST[box_1] .
$headers = " 2: " . $POST[box_2] .
$headers = " 3: " . $POST[box_3] .
$headers = " 4: " . $POST[box_4] .
$headers = " 5: " . $POST[box_5] .
$headers = " Name: " . $POST[theName] .
$headers = " Email: " . $POST[theEmail] .
// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $headers);
?>
WHAT AM I DOING WRONG??