I have created a class to easy the pain of generating captcha functionality on your registration (and what ever else) pages. Its a simple class and easy to use.
You can download here: Wattz.net Download Page
– Php5+ (with GD enabled)
$width = 100;
$height = 80;
$Chars = 8; //number of characters.
$lines = 100; //number of background lines.
$SecurityImage = new SecImg($width, $height, $Chars, $lines);
Here is an example setup for complete usage:
::::::::: USER REGISTRATION PAGE:
<input type=”text” name=”securityCode”>
<input type=”submit” value=”submit”>
:::::::::: Now for SecurityImage.php
$img = new SecImg(100,40);
$_SESSION[‘securityCode’] = $img->code;
:::::::::: Then you can validate in your registration page processing script like
if($_POST[‘securityCode’] != $_SESSION[‘securityCode’])
die(“Security Code does not match”);
Like I said, that is an example, there are many ways to do it. Well I hope you find this useful and I look forward to contributing more in the future.