В пыхыпы я дерево
на сайте другана не отображается картинка подтверждения авторизации и регистрации => не можем попасть в админку, нашли файлик который генерит ее, вот код
хелп, может тут где-то ошибка?
Код:
<?php
function randomPassword($length = 1) {
$all = explode( " ",
"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");
for($i=0;$i<$length;$i++) {
srand((double)microtime()*1000000);
$randy = rand(0, 61);
$passw .= $all[$randy];
}
return $passw;
}
$r1 = randomPassword($length = 1);
$r2 = randomPassword($length = 1);
$r3 = randomPassword($length = 1);
$r4 = randomPassword($length = 1);
$r5 = randomPassword($length = 1);
$r6 = randomPassword($length = 1);
$nm="$r1$r2$r3$r4$r5$r6";
if($status==restor) {
setcookie("gen_id_pass", $nm);
}
if($status==autoriz) {
setcookie("gen_id", $nm);
}
if($status==registr) {
setcookie("gen_id_reg", $nm);
}
if($status==mygood) {
setcookie("gen_id_good", $nm);
}
$rn=array($r1, $r2, $r3, $r4, $r5, $r6);
$w=165;
$h=50;
$ctr=ceil($h/2);
$img = ImageCreate($w,$h);
$back = ImageColorAllocate($img, 51, 102, 153);
$txt = ImageColorAllocate($img, 255, 255, 255);
$px = ImageColorAllocate($img, 222, 237, 251);
imageline($img, 2,2, $w-3,2, $txt);
imageline($img, 2,2, 2, $h-3, $txt);
imageline($img, 2,$h-3, $w-3, $h-3, $txt);
imageline($img, $w-3,2, $w-3, $h-3, $txt);
$r=$rn[0];
$x=8;
$angle=rand(-15,10);
for ($i=1; $i<=6; $i++)
{
imageTtfText($img, 20, $angle, $x, $ctr+10, $txt, "$DOCUMENT_ROOT/font/CASTLEB.TTF", "$r");
$r=$rn[$i];
$x=$x+27;
srand((double)microtime()*1000000);
$angle=rand(-30,30);
}
for ($i=1; $i<=1000; $i++)
{
imageSetPixel($img, rand(3,$w-3), rand(3, $h-3), $px);
}
ImagePNG($img);
?>