Token się nie pokazuje, jak powinien. Wziąłem go na test i po podaniu ścieżki do niego nic nie ma.
Token:
<?
$pool = '123456789'; //liczby z których bedziemy losować
$img_width = 100; //wymiary
$img_height = 16;
$str = ''; //wyzerowanie
for ($i = 0; $i < 5; $i++){ // losowanie
}
$string = $str;
$_SESSION['captcha'] = $string; //tworzymy sesje
$im = imagecreate($img_width, $img_height); //tworzymy
$bg_color = imagecolorallocate($im,255,255,255); // kolor tła
$font_color = imagecolorallocate($im,0,0,0); // kolor czcionki
$grid_color = imagecolorallocate($im,246,246,246); // kolor lini
$border_color = imagecolorallocate ($im, 246, 246, 246); // kolor ramki
// Tworzenie tokena
imagefill($im,1,1,$bg_color);
ImageLine($im,90,0,90,30,$grid_color); //1
ImageLine($im,10,0,10,30,$grid_color); //2
ImageLine($im,20,0,20,30,$grid_color); //1
ImageLine($im,30,0,30,30,$grid_color); //1
ImageLine($im,40,0,40,30,$grid_color); //1
ImageLine($im,50,0,50,30,$grid_color); //1
ImageLine($im,60,0,60,30,$grid_color); //1
ImageLine($im,70,0,70,30,$grid_color); //1
ImageLine($im,80,0,80,30,$grid_color); //1
ImageLine($im,0,5,100,5,$grid_color); //1
ImageLine($im,0,10,100,10,$grid_color); //1
ImageLine($im,0,15,100,15,$grid_color); //1
$x = rand(5
, $img_width/(7
/2
)); // pozycja liczb w tokenie
imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color);
for($a=0; $a < 7; $a++){
imagestring
($im, 3
, $x, 1
, substr($string, $a, 1
), $font_color); $x += (5*2); #odstęp
}
header("Content-type: image/gif"); imagegif($im);
imagedestroy($im);
?>
Ten post edytował Night123 23.01.2013, 16:41:33