我有这样的代码:
<div id="loginform">
<form enctype="multipart/form-data" action="/" method="post">
<label style="font-family: sans-serif; font-size: 14px; width: 195px;" for="name">Upload Image: </label>
<input style="font-family: sans-serif; font-size: 14px; width: 195px;" type="file" name="file">
<input style="font-family: Sans-serif;" type="submit" name="enter" id="enter" value="Upload" />
</form>
</div>
<?php
if(isset($_POST['enter']))
{
echo "
<div style=\"display: flex; height: 150px; box-shadow: 20px 20px 60px #bebebe;\">
<img height=\"150px;\" src=\"https://i.ibb.co/Lr07dyk/myQR.png\">
<span style=\"margin-top: 5px; font-family: sans-serif; font-size: 25px;\">Scan the QR code on another device <b>
<i>
<u>or</u>:
</i>
</b>
<br>
<span style=\"font-size: 16px;\">On another device, go to <a target=\"_top\" href=\"\">this website on another device</a> to view your images. </span>
</span>
</div>
";
}
?>但是当我重新加载页面时,我仍然看到“在另一个设备上,转到另一个设备上的这个网站来查看您的图像。”它不会消失的。
发布于 2022-10-21 14:50:22
这段代码将解决您的问题,我用您的代码进行测试(将它添加到代码的顶部)
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>祝好运
https://stackoverflow.com/questions/74154783
复制相似问题