這段執行出來看不到圖片﹐是個紅 X ﹐請問是什么原因﹖謝謝﹗
<?
Header("Content-type: image/PNG");
srand((double)microtime()*1000000);
$im=@imagecreate(110, 20);
$black=ImageColorAlloCate($im,0,0,0);
$white=ImageColorAllocate($im,255,255,255);
$gray=ImageColorAllocate($im,200,200,200);
imagefill($im,68,30,$gray);
imagestring($im,5,10,8,$_POST['authnum'],$black);
for($i=0;$i <50;$i++)
{
imagesetpixel($im,rand()%70,rand()%30,$black);
}
ImagePNG($im);
ImageDestroy($im);
?>
<?
Header("Content-type: image/PNG");
srand((double)microtime()*1000000);
$im=@imagecreate(110, 20);
$black=ImageColorAlloCate($im,0,0,0);
$white=ImageColorAllocate($im,255,255,255);
$gray=ImageColorAllocate($im,200,200,200);
imagefill($im,68,30,$gray);
imagestring($im,5,10,8,$_POST['authnum'],$black);
for($i=0;$i <50;$i++)
{
imagesetpixel($im,rand()%70,rand()%30,$black);
}
ImagePNG($im);
ImageDestroy($im);
?>
Fatal error: Call to undefined function: imagecreate()
注释掉了,可以执行。
Fatal error: Call to undefined function: imagecreate()
可能是GD库没开启吧