2019-05-05 11:29
浏览 10


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"]);.

    打赏 评论

相关推荐 更多相似问题