comment out content-type
line
header("content-type: image/png");
and try running the script again, it will show some error/notice/warnings.
質問
This is my php
<?PHP
$img = imagecreatetruecolor(305,100);
$green = imagecolorallocate($img, 180, 230, 225);
$blue = imagecolorallocate ($img, 10 , 10 , 150);
function random_string($lenght)
{
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ023456789";
srand((double)microtime()*1000000);
$str = "";
$i = 0;
while($i <= $lenght){
$num = rand() % 33;
$tmp = substr($chars,$num,1);
$str = $str . $tmp;
$i++;
}
return $str;
}
session_start();
$_SESSION['Real'] = random_string(7);
header("content-type: image/png");
imagefill($img,0,0,$blue);
imagettftext($img, 60,0,10,70,$green, "../Captcha/MyFont.ttf",$_SESSION['Real'] );
imagepng($img,"file.png");
imagedestroy($img);
?>
Yesterday this code was working. Then I added no cache in header and because of this it stopped working. Then I deleted thing that I added but nothing. I hundred times checked code from where I wrote this but nothing. Can someone help? Thanks.
正しい解決策はありません
他のヒント
comment out content-type
line
header("content-type: image/png");
and try running the script again, it will show some error/notice/warnings.