whizzykid Posted May 17, 2009 Share Posted May 17, 2009 Hi, i have this code for call back form.but i want the content of the form to come my email address.hw can i do that? this is my code if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`, `Brief Comments`) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int"), GetSQLValueString($_POST['Brief_Comments'], "text")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error()); thank you Quote Link to comment https://forums.phpfreaks.com/topic/158447-help-needed/ Share on other sites More sharing options...
MadTechie Posted May 17, 2009 Share Posted May 17, 2009 Okay.. then just use mail() and add the $_POST's to the body! Quote Link to comment https://forums.phpfreaks.com/topic/158447-help-needed/#findComment-835607 Share on other sites More sharing options...
whizzykid Posted May 17, 2009 Author Share Posted May 17, 2009 Hi thank u,explain better. Quote Link to comment https://forums.phpfreaks.com/topic/158447-help-needed/#findComment-835616 Share on other sites More sharing options...
BobcatM Posted May 17, 2009 Share Posted May 17, 2009 Go to the link MadTechie provided and it will explain it better. Quote Link to comment https://forums.phpfreaks.com/topic/158447-help-needed/#findComment-835617 Share on other sites More sharing options...
whizzykid Posted May 17, 2009 Author Share Posted May 17, 2009 Oh yea i did that but it still doesnt send the content of the form.this my code if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO `Call Back form` (Firstname, LastName, `Company Name`, `Phone Number`) VALUES (%s, %s, %s, %s)", GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($_POST['LastName'], "text"), GetSQLValueString($_POST['Company_Name'], "text"), GetSQLValueString($_POST['Phone_Number'], "int")); mysql_select_db($database_inteecom_ellen, $inteecom_ellen); $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error()); $youremailaddress = 'hgghg@yahoo.com'; $subject = 'Someone just Registered .'; $headers = 'From: me@.com'; $from = "some1 just registered"; $message = ' some1 just registered check it out.'; mail($youremailaddress, $subject,$from,$headers, $message); Quote Link to comment https://forums.phpfreaks.com/topic/158447-help-needed/#findComment-835632 Share on other sites More sharing options...
jlhaslip Posted May 17, 2009 Share Posted May 17, 2009 Better check that link again, I think you have the Mail() parameters wrong. mail( $to, $subject , $message , $headers , $additional_parameters ) Last 2 are optional. Quote Link to comment https://forums.phpfreaks.com/topic/158447-help-needed/#findComment-835682 Share on other sites More sharing options...
MadTechie Posted May 17, 2009 Share Posted May 17, 2009 Oh yea i did that but it still doesnt send the content of the form.this my code $message = ' some1 just registered check it out.'; mail($youremailaddress, $subject,$from,$headers, $message); Why would it.. it sends what you tell it to send.. you have choosen to send some1 just registered check it out. So thats what it sends try this! $message = $_POST['Firstname'].' just registered check it out.'; Quote Link to comment https://forums.phpfreaks.com/topic/158447-help-needed/#findComment-835945 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.