HomePHP Developing a Captcha Application with an Image Generator Class with PHP 5
Developing a Captcha Application with an Image Generator Class with PHP 5
PHP is a powerful server-side scripting language that is recognized for its flexibility for developing a huge variety of web applications with relative ease. Speaking more specifically, its robust set of graphic processing functions, which has been packaged into the popular GD extension, makes it perfectly suitable for building image generating classes with minor hassles.
This series, which is made up of three instructive tutorials, walks you through the creation of a highly-extensible image generator class, which can be easily adapted to work with other classes that require the interaction of image processing modules, such as dynamic banner mechanisms and noisy image applications.
You'll probably recall that over the course of the previous article, I demonstrated how to build a PHP 5-based image generator class that was provided initially with the capacity for displaying different dynamic image streams on the browser.
Of course, the feature to highlight here concerning the development of the aforementioned class was its ability to embed several input strings into the image stream in question. This feature makes this class ideal to use in conjunction with other web applications that require some kind of graphic processing, including the examples that I referenced a few lines above, that is dynamic banner systems and noisy graphics.
In this last article of the series I'm going to show you how to couple this class with a simple randomizer mechanism to implement a basic yet effective application that will be capable of outputting on the browser different random strings, which will be previously embedded into a predefined image stream.
As you might have guessed at this point, I'm talking about building the popular "captchas" (or noisy images), which can be really useful when you want to implement a simple mechanism for preventing automated submissions by robot scripts of the forms included in your web sites.
The experience can be instructive and -- why not? -- also fun. So now that I have introduced the topic that I plan to cover in this final article of the series, let's move forward and learn together how to build a pluggable noisy image system with PHP 5. Let's get started!