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

我如何用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"]);.

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

报告相同问题?

悬赏问题

  • ¥15 运筹学中在线排序的时间在线排序的在线LPT算法
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧