duanaidang6197 2013-07-28 21:02
浏览 49
已采纳

PHP echo语句后不显示IMG标记[关闭]

I've looked at other questions but haven't found the answer, I'm echoing an image from a DB query - which works - into an image tag, but the image isnt displaying in the browser, however the code is all in the source and when I open the image in my browser it is there!

my code;

echo '<a href="http://www.example.com/adClick.php?id='.$a[0]['id'].'" target="_blank"><img src="http://www.example.com/images/ads/JobAlert/'.$a[0]['Image'].'" /></a>';

rendered html;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<p></p><a href="http://www.example.com/adClick.php?id=3" target="_blank">
                        <img src="http://www.example.com/images/ads/JobAlert/eb6daad2c02b3ba3310c03b3ef77e0ceb801cd8b74742356b2e7af37ef39a5b468752706.png" />
                        </a>
</body>
</html>
  • 写回答

2条回答 默认 最新

  • dongyuanliao6204 2013-07-28 21:10
    关注

    Try empty the cache and check the address once more. We have had a problem where we saved a psd as png (but the content was still a psd), so it didn't show up in the img element, but when we followed the image link in the inspector, it was there...

    Some browsers lowercase the url. Try to replace JobAlert with jobalert and it won't work in any browser, probably because you have missed [NC] (Non Case sensitive) in .htaccess. Make sure the lowercase url will work, then the image should work too!

    Edit: Simon later pointed out that the image for some reason was blocked by the browser plugin AdBlock, something to keep in mind if your working with ads. Remember that you could ask to whitelist your site https://adblockplus.org/en/acceptable-ads.

    Good luck with finding the problem!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘