我想上传一个替换为旧图像的新图像并永久保存更改,但是在刷新我的页面后,浏览器会显示旧图像而不是新图像。我该如何解决这个问题?
在此处将图像上传到我的php文件中的代码:
<div><form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file1">
<input type="submit" name="submit100" value="upload">
</form>
<?php
error_reporting(0);
if(isset($_POST['submit100'])){
$con =mysqli_connect("localhost","root","","login");
$filename=$_FILES["file1"]["name"];
$tempname=$_FILES["file1"]["tmp_name"];
$folder="upload/".$filename;
move_uploaded_file($tempname, $folder);
echo"<img src='$folder' height='625' width='800'>";
$sql=mysqli_query( $con,"INSERT INTO `picture`(pic_1) Values('$folder')");
if ($sql!=null) {
}
else
{
echo'<script>alert("notnnnn done");</script>';
}
}
else{
echo "<img src='images/img-01.png' alt='IMG'>";
}
?> </div>