Ron
07-22-2007, 03:53 AM
Secure PHP Mailer v.02
by Ron
This is the PHP Mail Form I just completed today. It started out as a real quick way of emailing with just 1 page, but then got more and more complicated as I went on. I added numerous checks and security catches. I have thoroughly tested this, but I have made a few mistakes. I also tried to fully comment the entire script so that PHP newbies can understand it better and learn from it.
Features
+ Sends an email to an email address that you specify!
+ Fully commented script so you can learn from it.
+ Able to call the script whatever you want as long as it ends in .php and it will still work!
+ Carefully secures all your text fields so that no one can inject any code such as using GET vars in lieu of POST vars.
+ Cleans out ampersand codes to create awry characters.
+ Cleans out HTML >'s and <'s tags.
+ Makes sure no one can put anything extra into your email like extra headers to send an email to more than once person.
+ Easy to use IP banning capabilities.
+ Does not show that it sends the user's IP address through the Email.
+ Able to set a max length to your <textarea> field.
+ Uses JavaScript to show the user how many characters left he can use if you set a max length for the <textarea> field.
If you want to see the code in action, click on this link, fill out the form, and I will receive the email.
Test out: http://goons.freepgs.com/FUN/contactme.php
Source Code: http://goons.freepgs.com/php_scripts.php?p=Secure_PHP_Mailer
Hope you like this script! Feel free to change this, but if you use this, please comment and thank me by going to my website and clicking on an advertisement! :D
~Ron
by Ron
This is the PHP Mail Form I just completed today. It started out as a real quick way of emailing with just 1 page, but then got more and more complicated as I went on. I added numerous checks and security catches. I have thoroughly tested this, but I have made a few mistakes. I also tried to fully comment the entire script so that PHP newbies can understand it better and learn from it.
Features
+ Sends an email to an email address that you specify!
+ Fully commented script so you can learn from it.
+ Able to call the script whatever you want as long as it ends in .php and it will still work!
+ Carefully secures all your text fields so that no one can inject any code such as using GET vars in lieu of POST vars.
+ Cleans out ampersand codes to create awry characters.
+ Cleans out HTML >'s and <'s tags.
+ Makes sure no one can put anything extra into your email like extra headers to send an email to more than once person.
+ Easy to use IP banning capabilities.
+ Does not show that it sends the user's IP address through the Email.
+ Able to set a max length to your <textarea> field.
+ Uses JavaScript to show the user how many characters left he can use if you set a max length for the <textarea> field.
If you want to see the code in action, click on this link, fill out the form, and I will receive the email.
Test out: http://goons.freepgs.com/FUN/contactme.php
Source Code: http://goons.freepgs.com/php_scripts.php?p=Secure_PHP_Mailer
Hope you like this script! Feel free to change this, but if you use this, please comment and thank me by going to my website and clicking on an advertisement! :D
~Ron