這段執行出來看不到圖片﹐是個紅 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); 
?>

解决方案 »

  1.   

    先注释掉 Header("Content-type: image/PNG"); 然后去掉所有的@然后单独执行这个程序看是否报错
      

  2.   

    這樣會報錯﹐錯誤如下
    Fatal error: Call to undefined function: imagecreate() 
      

  3.   

    我把Header("Content-type: image/PNG"); 
    注释掉了,可以执行。
      

  4.   

    這樣會報錯﹐錯誤如下 
    Fatal error: Call to undefined function: imagecreate() 
    可能是GD库没开启吧
      

  5.   

    google之分win和linux,配置方法不同