
Michal Carson - 2005-02-22 22:24:45
Since there is no documentation with the package, I had to feel my way
through the setup. It took about 2 hours to get the examples working.
First clue: There are three directories needed here. Put the PHP files
in the top directory (I named it captcha). Put the image files into a
subdirectory named img. Under the img directory, create another
subdirectory named fonts for the the TTF files. So in the end you have:
captcha
+--img
+--fonts
Second clue: The image files and fonts are not included here at
phpclasses.org. According to a brief note included with the scripts,
these can be downloaded from the author's web site. Unfortuantely, I
could not get the file to open/gunzip. I raided my winnt/fonts directory
for a few TTF files and created some new background images. (Later, I
discovered that the script will work without the background images.) The
fonts need to be named in an array in class.img_validator.php and the
images should be 180x50-pixel jpegs named bg1.jpg through bg5.jpg.
So this fooling around is why it took 2 hours to set up. Once this was
done, the script worked very neatly.
My only change in the design has been to make the validation routine
return true or false rather than display a message. I prefer to let my
script take an action based on whether the code was entered correctly; a
message to the user doesn't help.
Thanks for the script. It fits neatly into my application and I've
learned a little more about image handling.