PHP Example
Screen shot
PHP Captch Code Script

<?php
$x=array(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",
\"w\",\"x\",\"y\",\"z\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",
\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\");

$str=\'\';

for($i=0;$i<5;$i++)
{
$str=$str.$x[rand(0,count($x)-1)];
}

$im=imagecreate(80, 40);
$background_color = imagecolorallocate($im, 139, 69, 19);
$text_color = imagecolorallocate($im, 255, 255, 255);
imageline($im, 0, 10, 80,60 ,$text_color);
imageline($im,70, 0, 0,70 ,$text_color);
imagestring($im, 5, 12, 10,  $str, $text_color);
header(\"Content-type: image/png\");
imagepng($im);
imagedestroy($im);
?>

\"\"

You can download source code here