开发者

Why is Safari and Chrome not displaying my gif, but a blue question mark?

开发者 https://www.devze.com 2022-12-29 04:31 出处:网络
I am displaying the following html to my browser (firefox works, however chrome and safari are not).What is displayed below in firefox is working as intended, but safari and chrome are displaying a bl

I am displaying the following html to my browser (firefox works, however chrome and safari are not). What is displayed below in firefox is working as intended, but safari and chrome are displaying a blue question mark with a box around it.

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

My php code is as follows: (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);

The 1x1t.gif file exists in the same directory as the script and everything works in firefox- however safari and chrome display a blue question mark...

What do I need to do to get safari and chrome behaving as intended?


was path problem. Resolving.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号