Alrighty, here we go. On Kirupa, there is a great tutorial for a flash based PHP contact form that I followed (awhile ago) here. I’ve always had trouble getting it to work, but have more or less been able to figure it out on my own… not any longer! It seems like every time I go to customize the appearance of the send button, the whole form breaks down (which is strange because there is no code inside the button symbol, just the hit/over/down junk). I leave all the AS and the PHP intact, but still, the contact form breaks. To complicate matters, my server was upgraded to PHP5 from PHP4, so now the PHP code may need to be updated.
Under the recommendation from another forum I found while trying to find a solution, I created a test php file that I can directly access via the web to test my server sending mail. I was able to send and receive mail fine, but I can’t get the variables to load when the send button is pressed.
I keep reading that the movie clip is advancing too quickly before the form data is loaded, and I’m using the onClipEvent stuff to prevent this… but anyways… I’ll stop rambling, here’s the code:
On the movie clip:
onClipEvent(data){
_parent.nextFrame();
}
On the send button:
on (release) {
form.loadVariables("email.php", "POST");
}
The whole form is labeled with the correct instance name, and each field has the correct variable assigned. The original tutorial uses _root.nextFrame(); but my contact form is called to action as an external swf, so it would advance the frame in the wrong file, which was why I changed it to parent.nextFrame.
I’ve also tried using on (press) for the send button which seemed to work in the past, but not now. The PHP file is correctly placed in the directory, and the PHP script reads as follows:
<?php
$sendTo = "taylor@yoelinphotography.com";
$subject = "Message from www.yoelinphotography.com!";
$headers = "From: " . $_POST["name"] ." <" . $_POST["email"] .">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-path: " . $_POST["email"];
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
?>
THANK YOU!!!