Visual and Audio PHP CAPTCHA Generation Class
PhpCaptcha is a library for generating visual and audio CAPTCHAs
(completely automated public Turing test to tell computers and humans
apart). You can read more about CAPTCHAs at Wikipedia.
It can help you to prevent/reduce:
- Automated sign-ups in registration forms.
- Comment spam in blogs and guestbooks.
- Brute force attacks on login systems.
A Word of Warning
OK, so this might sounds strange given what follows but please
consider whether you really need to use a CAPTCHA before implementing
this on your site. Although it's legitimate to use CAPTCHAs in some
situations you really need to be aware of the inherent accessibility pitfalls before implementing. I'd also encourage you to fully investigate the alternatives such as the Akismet spam filtering WordPress plug-in and API before resorting to a CAPTCHA to solve your spam problems.
Right, I've said my piece - on with the script.
Origins
The library is loosely based on an article I wrote for SitePoint which was published on 9th November 2005 - Toughen Forms' Security with an Image.
Supported Features
- Multiple random TrueType fonts
- Character rotation
- Optional chararacter shadow support
- Optional site owner display text
- Random custom background images
- Font size selection
- Greyscale or colour lines and characters
- Character set selection
- Integration of validation function for checking the user entered code with the generated code
Requirements
The library requires PHP 4 compiled with GD 1 or 2 (Image
Generation) and FreeType text support. It should work fine with Linux,
Mac OS X or Windows based systems although you will need to change the
default temporary file storage directory specified when using with
Windows. PHP session support is also required. The audio CAPTCHA
requires the Flite text to speech synthesis engine.