Created a simple contact mailer using the loadVariable(“email.php”, “POST”) action on a send button, I have a EmailStatus message that is displayed after you press the button but the PHP will not work code:
<?php
$sendTo = "[EMAIL="acondon747@yahoo.com"]acondon747@yahoo.com[/EMAIL]";
$subject = "Support Form";
$headers = "From: " . $_POST["name"];
$headers .= "Subject: " . $_POST["subject"];
$headers .= "<" . $_POST["email"] . ">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-Path: " . $_POST["email"];
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
Print _root.EmailStatus="Complete - Your message has been sent";
?>
Button code
on (release) {
if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
_root.EmailStatus = "Please enter a valid E-mail address";
} else if (!name.length) {
_root.EmailStatus = "Please Enter your name before Sending";
} else if (!message.length) {
_root.EmailStatus = "Please enter some text in you message";
} else if (!subject.length) {
_root.EmailStatus = "Please enter a subject for your message";
} else {
loadVariables("email.php", "POST");
_root.EmailStatus = "Message is being sent please wait...";
loading = "YES";
_this.gotoAndPlay(2);
}
In the form movie clip there are 3 frames 1st frame (stop()) ,2nd frame (just a keyframe),
3rd frame
if (loading eq "YES") {
gotoAndPlay(_currentframe-1);
} else {
_this.gotoAndStop(1);
}
I know the button works but there is no contact to the php im running on Mosso so I know it will run php both index.html and email.php are in the same root directory on the site. Where is the problem? Thanks in advance