I have a php mail form in a movie that’s being loaded into another movie’s container.
Everything works fine except the gotoAndStop part when the user hits submit. Ideally, I want it to go to frame 10 which is the successful message. However, as it stands with this code now the movie will jump to frame 20 instead (the error frame). But, the mail works fine. I’m assuming the problem lies in the fact that the movie this form is on is within another movie.
Here’s the code:
receiveLoad.onLoad = function(){
if(this.sentOk){
_root.gotoAndStop(10);
}
else {
_root.gotoAndStop(20);
}
}
and this is the PHP:
<?php
$to = "mpr@hatmontrecords.net";
$subject = "Message from your site";
$message = "<b>Name: </b>" . $sender . "<br>";
$message .= "<b>Email: </b>" . $email . "<br>";
$message .= "<b>Company: </b>" . $company . "<br><br>";
$message .= "<b>Message: </b>" . $message1;
$headers = "From: $email";
$headers .= "
Reply-To: $email" . "<br>";
$headers .= 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$sentOk = mail($to,$subject,$message,$headers);
echo "sentOk=" . $sentOk;
?>
I know that I need to make reference to the movie this form is in so it can separate the two movies but I’m not sure how to do that. I thought it was the “_root” bit but if I get rid of that it will not jump anywhere after hitting the submit button. Then I thought it might have something to do with the $sentOk variable in the php but that can’t be it because otherwise I wouldn’t get a jump to the error message frame. Now I’m not sure at all…Any suggestions?