0;--$i) { $size = rand(10, 16); $angle = rand(-31,35); $x = intval(rand(0, $xsize)); $y = intval(rand(0, $ysize - $size/5 )); $color = imagecolorallocatealpha( $gd, rand(150,170), rand(150,170), rand(150,170), rand(75,90) ); $text = substr('ABCDEFGHIJKLMNOPQRSTUVXYZ0123456789',rand(0,36),1); //echo $text; ImageTTFText($gd, $size, $angle, $x, $y, $color, 'fonts/FORTE.TTF', $text); } //echo '
'; $text=''; $letters='ABDFHJKMNOPQRSUVXY123456789'; for($i=rand(10,11);$i>0;--$i) { $size = rand(14, 16); $angle = rand(-10,15); $x = min(max($xsize-($i*18+rand(0,5)),0),$xsize-16); $y = rand($ysize *0.4,$ysize *0.6 ); //echo "$y,"; $color = imagecolorallocatealpha( $gd, rand(150,180), rand(150,180), rand(150,180), rand(2,13) ); $t = substr($letters,rand(0,strlen($letters)),1); //echo $t; ImageTTFText($gd, $size, $angle, $x, $y, $color, 'fonts/FORTE.TTF', $t); $text.=$t; } if(!$demo) { $_SESSION['captcha']=$text; } else { $color = imagecolorallocatealpha( $gd, 0, 0, 0, 0 ); imagettftext($gd,15,0,0,$ysize+20,$color,'fonts/arial.ttf',$text); } header('Content-type: image/png'); imagepng($gd);