duandai2178 2017-03-28 09:15
浏览 60

在PHP中加载图像文件时出现问题

I am facing some typical issue in loading image files in PHP. Image got successfully loaded but cannot get displayed properly.

I have declared a define value, then echoed it in an img tag src attribute :

define('image_site_url','localhost/projects/faantush/product_images/');
<img src="<?php echo image_site_url.$row['image1'] ?>" />

The image file is not found but it is there in product_images. Here are the pictures:

Screenshot of the DOM in browser inspector Screenshot that proves that the image is correctly served

  • 写回答

2条回答 默认 最新

  • doubangzhang6992 2017-03-28 09:17
    关注

    In the HTML code: You are missing the: http:// before localhost

    <img src="http://localhost/ ...

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度