--------------------------------------------------------------------------------
Hi,
I'm trying to make it mandatory to fill in the text fields on my Flash form. I
thought I had the actionscript correct, but whenever someone hits send without
completing the fields, the email goes through anyway and they are taken to the
confirmation page instead of the error page I created. The confirmation page is
in frame 2 and the error page is in frame 10. Any help would be appreciated.
Thanks.
Lee
actonscript on the "send" button:
on (release) {
if (name eq "" or email eq "" or phone eq "") { gotoAndPlay(10);
} else {
_root.paper.loadVariables("email.php", "POST");
}
}
actionscript on the movie clip:
onClipEvent (data) {
_root.gotoAndPlay(2);
}
php file:
//use the code maker for this at
[url]
http://flashmailforms.com/writeemail.php[/url]
<?
//toss in your email address here
$sendTo = "info@vino101.com";
//type what you want as subject here
$subject = "Info from Flash Mail Forms site.";
$ip = $_SERVER['REMOTE_ADDR'];
// header information not including sendTo and Subject
// these all go in one variable. First, include From:
$headers .= "From: " . $_POST["name"] .">\r\n";
// next include a replyto
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
//put the message text variable here
$message = $_POST["name"] .">\r\n" . $_POST["email"] .">\r\n" .
$_POST["phone"] .">\r\n" . $_POST["message"] . "\r\n\n\n" . "Sender's ip
address is " . nl2br($ip);
// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);
?>