dongxu0690 2019-05-05 11:29
浏览 11
已采纳

我如何用php显示哪些图像已经在输入类型文件中上传?

I have database structure as such for image that it stores it name and moves upload to a uploads directory via move_uploaded_file(). I have a page where people can edit what they have uploaded to that specific post. Commonly it is done via giving an value for input but what ever I put inside input is not being displayed. Basically I wants to show which image is uploaded with that specific post.

Html (doesn't works )

   <input class="" value="<?php echo $row['post_image'] ?>" type="file" id="addPost_post_image" name="addPost_post_image">

echo $row['post_image'] shows which image name is stored. and is giving right info.

Image is placed under a folder uploads.

  • 写回答

1条回答 默认 最新

  • duanji5569 2019-05-05 11:46
    关注

    Try putting <img src="uploads/<?php echo $row['post_image'] ?>"> next to input field. I assume you have an image name saved in the database row post_image. If not then get name from basename($_FILES["addPost_post_image"]["name"]);.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器