代码之家  ›  专栏  ›  技术社区  ›  Kladskull

为什么Safari和Chrome不显示我的gif,而是一个蓝色的问号?

  •  0
  • Kladskull  · 技术社区  · 16 年前

    <html>
      <head>
        <title>test</title>
      </head>
      <body>
        <img src='pixel.php' />
      </body>
    </html>
    

    我的php代码如下: (pixel.php)

    // send the right headers
    $expiry = 0;
    header('Expires: 0');
    header('Cache-control: private, max-age=0');
    header('Content-Type: image/gif');
    header('Content-Length: ' . filesize($fileName));
    
    // get a file pointer to the image
    $fp = fopen($fileName, 'rb');
    
    // dump the picture and stop the script
    fpassthru($fp);
    

    我需要做什么才能让safari和chrome按预期运行?

    1 回复  |  直到 16 年前
        1
  •  0
  •   Kladskull    15 年前

    是路径问题。正在解决。