PDA

View Full Version : Flash Based Email Form Using PHP---HELP!!!



jborgschulte
February 9th, 2007, 09:33 PM
Hello, so I've got a problem with the Flash Based Email Form Using PHP (http://www.kirupa.com/forum/../developer/actionscript/flash_php_email.htm) tutorial. I've done hours of searching through the forums to find the solution, and have not been able to adapt those solutions to help me yet.

Right now, once I click "send" it just gives me a transferring message in the status bar of my browser, but it doesn't ever send an email. I know my host provides PHP. I set up a test PHP file with the following code:
<?php phpinfo() ?> It gives me a page with the information concerning my host's PHP capabilities. So, that's not the problem.

Here's the PHP code I have in a file called "quicknote.php":

<?php
$to = "josh@joribo.com";
$subject = "A Quick Note...";


$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["email"];

$message .= "This message has been sent from your Contact Form\n\n";
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "Email: " . $_POST["email"] . "\r\n";
$message .= "Message: " . $_POST["content"] . "\r\n";

mail($to, $subject, $message, $headers);
?>Below, I've also attached a zip of my .FLA that sends the info to the PHP script.

Please advise me what I need to change. Thanks in advance.

jborgschulte
February 10th, 2007, 05:25 PM
So, I've been exploring this problem, and I found my solution in case anybody reads this and wants to know.

My problem was not in the PHP code or the AS code, it was the placement of the contact.swf file. I had it in a folder, and that folder was on the same level as the main.swf file. So, I moved the contact.swf out of the folder on the same level as the main.swf, adjusted the loadMovie linkage. and it began sending emails perfectly. Except for the TEXTFORMAT error that I've seen others get as well.

The solution for all the html tags in your email is to put this code in the "form" movieclip on an actions layer:


myInstanceName.html = false;

"myInstanceName" is for each text field you have in the "form." So, you have to have a line for each input text field you have.

Hope this helps other people.

:cap: