If the images packaged with this script don't suit your design, feel free to exchange them for your own!
Here is the format for image filenames, since, obviously, files named "one.jpg" and "two.jpg" wouldn't trick any decent algorithm:
0 cl20cl25346.jpg
1 cl21cl25346.jpg
2 cl22cl25346.jpg
3 cl23cl25346.jpg
4 cl24cl25346.jpg
5 cl25cl25346.jpg
6 cl26cl25346.jpg
7 cl27cl25346.jpg
8 cl28cl25346.jpg
9 cl29cl25346.jpg
*/
// How many digits long you want your captcha to be
$number_of_digits = 5;
// Generate the order of digits
function rand_permute($size, $min, $max) {
$retval = array();
for($i = $min;$i <= $max;$i++) {
$retval[$i] = $i;
}
for($i=$min; $i < $size; $i++) {
$tmp = $retval[$i];
$retval[$i] = $retval[$tmpkey = mt_rand($min, $max)];
$retval[$tmpkey] = $tmp;
}
return array_slice($retval, 0, $size);
}
$series = rand_permute($number_of_digits,0,9);
for ($i=0; $i<$number_of_digits; $i++) {
$answer .= $series[$i];
}
// Display the digits
// The JavaScript obfuscates this code:
// It's another layer of protection from spam algorithms
print '