I have this form in my flash file and I can’t quite make it do what I want.
I get the form to send, but I don’t get a confirmation if it sent out OK, and I also can’t make the auto response work in the php file. My Flash file has the following AS in it.
this.send_btn.onRelease = function() {
validateForm(tf_Name,tf_Email,tf_Subject,tf_Comments);
};
function validateForm(tName:String, tEmail:String, tSubject:String, tMsg:String):Void {
trace(“the else was called…”);
var send_lv = new LoadVars();
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
trace(this.tf_showAlertMsg);
if (success) {
this.tf_showAlertMsg.text = “Thank you for sending us an email”;
} else {
this.tf_showAlertMsg.text = “Email did not go through”;
}
};
send_lv.Name = tName;
send_lv.FromEmail = tEmail;
send_lv.Subject = tSubject;
send_lv.Comments = tMsg;
send_lv.status = “”;
send_lv.sendAndLoad(“php/sendContact.php”,result_lv,“Post”);
this.showAlertMsg(“Sending…”);
}
My PHP looks like this:
<?php
$debug = true;
$debug = false;
$Name = $HTTP_POST_VARS[“Name”];
$Email = $HTTP_POST_VARS[“FromEmail”];
$Subject = $HTTP_POST_VARS[“Subject”];
$Comments = $HTTP_POST_VARS[“Comments”];
//create the message
$Intro = "Name: $Name
"."Subject: $Subject
"."Email: $Email
“;
$Message = $Intro.”
".$Comments;
//if($debug)
echo "mes1 $ToEmailType $ToEmail $Subject $Message From: $Name $FromEmail
";
//mail to Eric Tillinghast
mail("brian@agilitygraphics.com",“website contact form - $Subject”, $Message, “From: $Name <”.$Email.">");
//mail acknowledgement to the user
$AcknowledgementMessage = "Hello $Name.
Thank you for your interest in my art. I have received your email and will respond as soon as possible.
Thank You,
Eric Tillinghast.
www.erictillinghast.info";
mail($Name."<".$Email.">", “I have received your email”, $AcknowledgementMessage, “From: Eric Tillinghast <info@erictillinghast.info>”);
echo “&Status=Your quote request has been sent.”;
?>
How can I get the php to report back to the result_lv and get the confirmation email from the form.
Thanks a lot for any help with this!!!