ValidationCode

When I first started this site I wanted to let the visitors to post comments and send mails to me without having to register and login. This worked fine, or at least until after a few months when some spamscript found my site and started to fill the guestbook and project comments with spam of all sort. To solve this I wrote this little PHP-hack.

How does it work?

The solution contains two parts. The most important part is the PHP-script that generates a validation code, stores it in the session-variable and displays it as a tweaked image. The second part is the small PHP-script to confirm the validation code.

You can see this hack in action further down on this page or try the example out here. Check out the MailForm project for another example.

Downloads


Comment this project:

Your name:
Your email (hidden):
Message:
Enter the validation code :
Private! (visible for webmaster only)

pymike 2008-09-03 21:42:21

Awesome work! I got it working on my site (http://pymike.4rensics.org) and I am no longer plagued by spambots :-) It did, however, take some editing to get it to work. I guess you're using an earlier version of PHP :-P Thanks for making all these awesome projects!