<tr>
<td class="text-left">Price:</td>
<td><input type="text" placeholder="Price" name="price" value="<?php echo $result['price'];?>"/></td>
</tr>
<tr>
<td class="text-left">Profile Image:</td>
<td><input type="file" name="proimage" value="<img src=upload/<?php echo $result['proimage'];?>" height="50px"/></td>
</tr>
这是我的代码。但图片无法查看以进行编辑。
最佳答案
<input type="file" name="proimage" value="<img src=upload/<?php echo $result['proimage'];?>" height="50px"/>
^
This is invalid
Like this you can't display image
你只需要 <img>
标签,显示数据库中已有的图像
<img src="upload/<?php echo $result['proimage'];?>" height="42" width="42" >
对于您可以拥有的表单,输入带有值的标签,
<!-- since already there in db make it hidden -->
<input type="hidden" name="proimage" value="<?php echo $result['proimage'];?>" />
关于javascript - 在核心 php 中,我需要在数据库中添加的编辑字段中查看图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46686198/