PDA

View Full Version : Secure PHP Mailer by Ron



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

Jason2gs
07-22-2007, 06:34 PM
Thanks, I'm sure to learn something from it :p

Wait... Your Goons?


// If SendToWeb is true, what website up until the k= ?
Website = 'http://goons.freepgs.com/SCAR/MasterKeyLogger.php?k=';

I've always wondered about that :rolleyes:

Ron
07-23-2007, 01:04 PM
Glad you like it and heh, yea that's my website. I have stupid stuff on there lol, and haven't updated in forever until recently adding php scripts. :)

cathering_
07-23-2007, 08:01 PM
Its nice, you should add a session with a random number that is md5 and put the same value in a hidden input in the form that way its almost impossiable to copy it and use it off a diffrent domain or page if u wont include the random number :P

Here
07-25-2007, 04:53 AM
Ah, an anonymailer. Always useful. Thanks, I'll take a look at it.

cathering_
08-01-2007, 01:45 AM
Grrrr my mailer I made of my site won't work :( ill use your one :) besides I only have to fit into my website

bullzeye95
08-01-2007, 01:48 AM
Post the bomber Ron! I'm spamming an idiot at my school with 15000 right now xD

dvdcrayola
08-17-2007, 12:27 AM
will this be hard for me to edit if i have no PHP background??

Drunkenoldma
08-17-2007, 11:56 PM
will this be hard for me to edit if i have no PHP background??

yes

dvdcrayola
08-18-2007, 12:12 AM
arg.. ok maybe ill learn some

Ron
08-19-2007, 06:59 PM
dvdcrayola, what part about it do you need to edit? If it's only the email you are going to have the PHP mailer send to, then all you have to do is change one variable and it tells you which one to change. :)

dvdcrayola
08-19-2007, 09:27 PM
no, i need to edit it to have other feilds.. for example problem.. but i might just not make it if its to much of a hastle