MyBB Community Forums

Full Version: Simple and Secure PHP Form.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I posted this up here but after seeing rcpalace's thread I figured others here might be interested. Not to say his isn't good, but some people like CAPTCHA with their forms and I use whitelists on mine to prevent injection and spam abuse (not sure what methods he used but I didn't see any whitelist or blacklist code in his).

Features
~Easy to use and customize.
~Anti-SPAM via CAPTCHA. (Not my CAPTCHA code.)
~Form input security. (RegEx whitelist to prevent exploitation.)
~Recording of sender's IP.

View Demo

(Sample HTML file, PHP file, and CAPTCHA file included in attached zip.)
[attachment=11083]
thank you for sharing. nice and easy to fellow. this sure better then some of the other ones out there. this is going to be a great help to website owners.

and people learing php on how do this this the easy way Big Grin
This was the first script I've wrote myself pretty much. It's hard to find a HTML to PHP form that includes CAPTCHA and other basic features. Big Grin
Good Job. I did notice you added some different security measures than what I added. I just added the general htmlentities instead of checking if it's only alphanumeric. You could have saved some time by just using this php function for checking if it's alphanumeric or not: ctype_alnum();

Here's the php function to check if it's only alphabetic characters: ctype_alpha();

The functions above are PHP 4.0.4+ compatible.
Best Regards.