PDA

View Full Version : Help with a simple flash/PHP mail form



plangdon
November 4th, 2007, 12:45 PM
Hello,

I am new to flash and am having problems getting a mail form to work.

I have been using the tutorial on this site at
http://www.kirupa.com/developer/actionscript/flash_php_email.htm

I can get this to work fine, but I want to add an extra category to my form so people can enter their phone number. I have a text field with the var name 'phone', and all I want to know is what I need to do to the PHP code to make the phone number be included in the main body of the email as well as the message text.

Here is the php code I'm using --

<?php

$sendTo = "peter.langdon@inbox.com";
$subject = "Message from web site";


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

$message = $_POST["body"];

mail($sendTo, $subject, $message, $headers);

?>

---


Any help would be much appreciated.

Thank you!

Peter

Adam
November 4th, 2007, 12:56 PM
<?php

$sendTo = "peter.langdon@inbox.com";
$subject = "Message from web site";


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

$message = $_POST["body"] . "\r\n";
$message .= "Phone: " . $_POST["phone"];

mail($sendTo, $subject, $message, $headers);

?>

Should work I believe...been a while since I've touched anything like this, so sorry if I'm off. Give it a shot.

plangdon
November 4th, 2007, 02:57 PM
Thanks for your help, but that doesn't seem to be working. I'm not getting any emails now.

Anyone have any other ideas?

Thanks a lot

Peter

plangdon
November 4th, 2007, 03:52 PM
<?php

$sendTo = "peter.langdon@inbox.com";
$subject = "Message from web site";


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

$message = $_POST["body"] . "\r\n";
$message .= "Phone: " . $_POST["phone"];

mail($sendTo, $subject, $message, $headers);

?>

Should work I believe...been a while since I've touched anything like this, so sorry if I'm off. Give it a shot.


My aplogies - it is working perfectly (the email just took a while to come through). Thanks a lot for your help!

Peter

Adam
November 4th, 2007, 04:46 PM
No problem, glad you got it :)