PDA

View Full Version : Email form


URackEm
04-02-2008, 12:49 AM
I'm very much a novice with php, but have learned a lot in my research for this project. The flash side seems to be working properly, im just not sure I have the php side scripted correctly, as I never seem to receive an email when I test it.


<?
//Destination Email ID
$to = "email@someemail.com";

//Name of the Person
$namenew=$_GET['full_name'];

//Home Phone of the person
$homenew=$_GET['home_phone'];

//Cell Phone of the person
$cellnew=$_GET['cell_phone'];

//Email Id of the person
$emailnew=$_GET['email'];

//Date of appointment request
$datenew=$_GET['day'];

//Time of appointment request
$timenew=$_GET['time'];

//Building Number of the person
$bldgnew=$_GET['bldg_number'];

//Unit Number of the person
$unitnew=$_GET['unit_number'];

//Notes
$notesnew=$_GET['notes'];

//Subject line of the email
$subject="Appointment Request:"." "."$emailnew";

/*************** Email Body ***************/
$matter="Below are the details filled by"." "."$namenew"."\n\n".
"Name:"." "."$namenew"."\n\n".
"Home Phone:"." "."$homenew"."\n\n".
"Cell Phone:"." "."$cellnew"."\n\n".
"Email:"." "."$emailnew"."\n\n".
"Date Requested:"." "."$datenew"."\n\n".
"Time Requested:"." "."$timenew"."\n\n".
"Building Number:"." "."$bldgnew"."\n\n".
"Unit Number:"." "."$unitnew"."\n\n".
"Customer Notes:"." "."$notes"."\n\n";
/******************************************/

mail($to, $_GET["$subject"], $_GET["$matter"], "From: phpMailer Reply-To: $_GET["$emailnew"] X-Mailer: PHP/" . phpversion());

?>


Because I have a multiline input field I use the post method, so I use the following:


loadVariablesNum(mailto.php, 0, "POST");

I am not 100% sure I have the syntax correct for the Mail() command. All of the variables are input and posted from within one of several (but always from only one) movieclips.

Any and all help is appreciated.

Cota
04-02-2008, 03:37 AM
few pointers. If you're using POST in Flash, you have to use POST in php. Currently you have POST in Flash, and GET in php. In the mail() call, you dont need to use GET at all. $ declares the php variable, which have been set, GET is not needed there, $variable will do.

atomic
04-02-2008, 03:53 AM
http://tutorials.flashvacuum.com/index.php?show=Email101

URackEm
04-02-2008, 07:03 PM
Making some changes and will be testing again soon. Thank you for your input.

URackEm
04-03-2008, 05:48 PM
That did the trick. Thank you guys. Works like a dream now.

atomic
04-03-2008, 05:49 PM
Grrrrreat! ;)