News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

CodedFX.com:
Creating a CAPTCHA for Your Site
April 04, 2006 @ 13:02:51

Via a pointer from the Zend Developer Zone, there's a new bit of code over on CodedFX.com to help you generate a CAPTCHA image to prevent spam messages from bots in your comments.

There's two files in his example - the main PHP that does the work and a font file to pull the text from. The code is pretty straight-forward, and can almost be cut and paste into any kind of application. Working with the font file is a little tricky, but GD has built-in functionality to work with it.

The script allows for any kind of true-type font input, multiple color schemes, transparency, and the ability to angle the letters to make them harder to interpret. The resulting output from his script is a PNG image, but with a few modifications, it could create JPEGs as well.

0 comments voice your opinion now!
create captcha image spam prevent GD PNG create captcha image spam prevent GD PNG


blog comments powered by Disqus

Similar Posts

Matthew Weier O'Phinney's Blog: Zend Framework 1.6.0 Preview, or, PHP 4 is Dead

Richard Davey's Blog: Interesting memory use with GD images

Sameer Borate's Blog: Unpacking binary data in PHP

Performancing.com: HOW TO - Create Intelligent Blog Ads

Pierre-Alain Joye\'s Blog: 5.1.3 is out, Congrats! (and finally)


Community Events





Don't see your event here?
Let us know!


list api series symfony bugfix voicesoftheelephpant library package introduction install language laravel community tips opinion deployment podcast framework release interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework