';
} else echo '
';
// destroy image
imagedestroy($image);
// delete all captcha images at 12 and 3 oclock if more than 100 are found
$dt=date('g');
if(($dt==12)||($dt=='12'))capya_cleanup();
else if(($dt==3)||($dt=='3'))capya_cleanup();
}
function capya_cleanup(){
$files=glob(CAPYADIR."apache*.jpg");
if(sizeof($files)>100){
foreach ($files as $filename) {
unlink($filename);
//echo "$filename size " . filesize($filename) . "\n";
}
}
}
function capya_string($len){
$str='';
for($i=1; $i<=$len; $i++) {
$ord=rand(48, 90);
if((($ord >= 48) && ($ord <= 57)) || (($ord >= 65) && ($ord<= 90))) $str.=chr($ord);
else $str.=capya_string(1);
}
return $str;
}
?>