Or u myt prefer a captcha image script
<?php
$font = 'arial.ttf';
$lineCount = 10;
$fontSize = 10;
$height = 25;
$width = 80;
$ih = imagecreate($width,$height) or die('GD Library must be installed.');
$bgColor = imagecolorallocate($ih,0,0,0);
$lineColor = imagecolorallocate($ih,178,238,238);
$txtColor = imagecolorallocate($ih,255,255,255);
$str = 'abcdefghijklmnopqrstuvwxyz0123456789';
for($x=0;$x<6;$x++){
$pos = rand(0,strlen($str));
$stri .= $str{$pos};
}
$textbox = imagettfbox($fontSize,0,$font,$stri) or die('Try replacing imagettfbox with imagettfbbox function on d left.');
$x = ($width - $textbox[4])/2;
$y = ($height - $textbox[5])/2;
imagettftext($ih,$fontSize,0,$x,$y,$txtColor,$font,$stri);
for($x=0;$x<$lineCount;$x++){
$x1 = rand(0,$width); $x2= rand(0,$width); $y1 = rand(0,$width); $y2 = rand(0,$width);
imageline($ih,$x1,$y1,$x2,$y2,$lineColor);
}
header('Content-type: image/jpeg');
imagejpeg($ih,NULL,75);
imagedestroy($ih);
session_start();
$_SESSION['captchaAuth'] = $stri;
?>
Store that code above as captchaimage.php
//the form
echo '<img src="captchaimage.php" alt="captcha"/><br/>Enter text above:<input type="text" maxlength="6" name="auth"/>';
//the authentication
session_start();
if($_POST['auth']!=$_SESSION['captchaAuth']){ echo 'Incorrect code, try again. Note: cAsE SenSITivE VaLUE';
}else{
//continue reg
}
Remember, download arial.ttf FONT, and save it in d same directory as ur php code. You can get one in ur windows folder on any pc. C:\WINDOWS\FONT(or fonts)