CTI Posted April 13, 2006 Share Posted April 13, 2006 This is my form: <form name="form1" method="post" action="[b]mailer.php[/b]" onsubmit="return formCheck(this);" > <table width="303" border="0" cellspacing="10" cellpadding="0"> <tr> <td width="283">Name: <input name="Name" type="text" id="Name" size="35"></td> </tr> <tr> <td>Email: <input name="Email" type="text" id="Email" size="35"></td> </tr> <tr> <td><div align="center"> <input name="Reset" type="reset" id="Reset" value="Reset"> <input type="submit" name="Submit" value="Submit"> </div></td> </tr> </table> </form>and this is how I set up my mailer.php, if you need the whole thing, just let me know:$to = "[b]email@gmail.com[/b]"; #this is the email i set up, but i still have not received the email...$subject = "Member"; #set the subject line $headers = "Soon to be Member"; #set the from address, or any other headers $forward = 0; # redirect? 1 : yes || 0 : no $location = "thanks.html"; #set page to redirect to, if 1 is abovedoes anyone know why I do not get the email when I fill out the form and hit submit?thanks Quote Link to comment Share on other sites More sharing options...
bonaparte Posted April 13, 2006 Share Posted April 13, 2006 [!--quoteo(post=364282:date=Apr 13 2006, 12:09 AM:name=CTI)--][div class=\'quotetop\']QUOTE(CTI @ Apr 13 2006, 12:09 AM) [snapback]364282[/snapback][/div][div class=\'quotemain\'][!--quotec--]This is my form: <form name="form1" method="post" action="[b]mailer.php[/b]" onsubmit="return formCheck(this);" > <table width="303" border="0" cellspacing="10" cellpadding="0"> <tr> <td width="283">Name: <input name="Name" type="text" id="Name" size="35"></td> </tr> <tr> <td>Email: <input name="Email" type="text" id="Email" size="35"></td> </tr> <tr> <td><div align="center"> <input name="Reset" type="reset" id="Reset" value="Reset"> <input type="submit" name="Submit" value="Submit"> </div></td> </tr> </table> </form>and this is how I set up my mailer.php, if you need the whole thing, just let me know:$to = "[b]email@gmail.com[/b]"; #this is the email i set up, but i still have not received the email...$subject = "Member"; #set the subject line $headers = "Soon to be Member"; #set the from address, or any other headers $forward = 0; # redirect? 1 : yes || 0 : no $location = "thanks.html"; #set page to redirect to, if 1 is abovedoes anyone know why I do not get the email when I fill out the form and hit submit?thanks[/quote]You never called the mail() function.[a href=\"http://in.php.net/manual/en/function.mail.php\" target=\"_blank\"]http://in.php.net/manual/en/function.mail.php[/a] Quote Link to comment Share on other sites More sharing options...
CTI Posted April 13, 2006 Author Share Posted April 13, 2006 [!--quoteo(post=364299:date=Apr 13 2006, 01:24 AM:name=bonaparte)--][div class=\'quotetop\']QUOTE(bonaparte @ Apr 13 2006, 01:24 AM) [snapback]364299[/snapback][/div][div class=\'quotemain\'][!--quotec--]You never called the mail() function.[a href=\"http://in.php.net/manual/en/function.mail.php\" target=\"_blank\"]http://in.php.net/manual/en/function.mail.php[/a][/quote]OK, so basically it's something like this:<?PHP mail("toaddress", "subject", "message body", "additional_headers"); ?> but where do I put that,? Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted April 13, 2006 Share Posted April 13, 2006 This might not be perfect, but you should get the idea. since you're using the additional headers, I've added a simple spammer hack detector. the mail funciton follows.mailer.php[code]<? if((strpos($_POST['Name'],"\n",1)) OR (strpos($_POST['Name'],"\r",1)) OR (strpos($_POST['Email'],"\n",1)) OR (strpos($_POST['Email'],"\r",1))) die(); // check for email form hack attempts, if present, do nothing.mail("email@gmail.com","Subject","Message","From: ".$_POST['Name']." <".$_POST['Email'].">"); // if there were no hack attempts, the following HTML will print.?><html><head><title>Thank You!</title></head><body>Thank you for sending me your information.</body></html>[/code] Quote Link to comment Share on other sites More sharing options...
CTI Posted April 14, 2006 Author Share Posted April 14, 2006 [!--quoteo(post=364451:date=Apr 13 2006, 10:19 AM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ Apr 13 2006, 10:19 AM) [snapback]364451[/snapback][/div][div class=\'quotemain\'][!--quotec--]This might not be perfect, but you should get the idea. since you're using the additional headers, I've added a simple spammer hack detector. the mail funciton follows.mailer.php[code]<? if((strpos($_POST['Name'],"\n",1)) OR (strpos($_POST['Name'],"\r",1)) OR (strpos($_POST['Email'],"\n",1)) OR (strpos($_POST['Email'],"\r",1))) die(); // check for email form hack attempts, if present, do nothing.mail("email@gmail.com","Subject","Message","From: ".$_POST['Name']." <".$_POST['Email'].">"); // if there were no hack attempts, the following HTML will print.?><html><head><title>Thank You!</title></head><body>Thank you for sending me your information.</body></html>[/code][/quote]Wow thank you very much man. That's awesome! :) Quote Link to comment 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.