This is very similar to the other post. I have made a contact form. The information is in a MC called form. On the first keyframe it has this code:
PHP Code:
stop();
// this function empties the text boxes once
// the mail has been sent - you could just as easily use it
// to remove or hide an mc or whatever you want
function emptyTxtBoxes2() {
name.text = "";
email.text = "";
text.text = "";
}
// check boxes function
function checkBoxes2() {
if (!name.text.length) {
gotoAndStop("feedback");
theresponse.text = "Please type in your name";
} else if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
gotoAndStop("feedback");
theresponse.text = "Please type a valid email address";
} else if (!text.text.length) {
gotoAndStop("feedback");
theresponse.text = "Please type your message";
} else {
sendmail2();
}
}
// newLoadvars - convert txtx boxes to variables
function sendmail2() {
myLVs = new LoadVars();
myLVs.name = name.text;
myLVs.email = email.text;
myLVs.message = text.text;
myLVs.onLoad = function(success) {
if (success) {
// clear text boxes
emptyTxtBoxes2();
// tell user mail has been sent
gotoAndStop("feedback");
theresponse.text = this.response;
}
};
myLVs.sendAndLoad("mailform.php", myLVs, "POST");
}
send_form.onRelease = function() {
checkBoxes2();
};
the php file has a parse error on line 15, but the code is very similar to the mailing list one and that is error free, but the email doesn't send.
The problem with this is that the email doesn't send and there is NO response at all. I am a php beginner so sorry i can't see the error. I really need to sort out this though.
This is the php code:
PHP Code:
<?php
//collect vars from flash
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
/*add anyother variables that you
want displayed in the email*/
$ToSubject = "message from my site";
$ToM = "[email protected]";
$sendTo = "freemojo";
$myMessage = "$name has sent you an email from your site with this message:\n\n$message\n\nReply to: $email";
mail($sendTo "<".$ToM.">",$ToSubject,$myMessage,"From:".$name."<".$email.">");
/*response to sender*/
$response = "Thanks for your message $name";
/*echo response to flash*/
echo '&response='.urlencode($response);
?>
Please help if you can. Thanks alot. Also have a look at the other post too, i'm really in need of the help!