在ie和chrome中无法显示图像


Image not displayed in ie and chrome

我有一个图像标签,我已经给src属性http://mydomain/attachment.php?attachmentid=391&thumb=1.

<img width='100' height='75' border='0' src='../attachment.php?attachmentid=$picture[attachmentid]&amp;thumb=1'/>

它在firefox中显示正常,但当我检查ie &Chrome,图像不显示。我甚至试图复制url &然后直接在浏览器中执行同样的事情。这是发生在wordpress php exec小部件

我无法找出这个问题的原因。

请帮我一下。

问候,

Pankaj

Firefox在图像标题方面比IE和Chrome更宽容。可能的情况是,你的脚本显示的图像没有预期的标题,让IE/Chrome正确识别它们为真实的图像。

你应该稍微摆弄一下标题,比如:

header('Content-Type: image/gif');

也许是有趣的阅读:在这里