JS code: < script>】"/> JS code: < script>】">
Home > Article > Backend Development > How to set up to turn off page refresh in php?
php set the method to turn off page refresh: first use the [location.reload()] function; then enter the html code [JS code: <script>】</script>
##php sets the method to turn off page refresh:
1. In actual application, when refreshing the page, we usually use:location.reload() or
history.go(0) to do it.
<?phpecho "<script type='text/javascript'>document.location.href='当前页面文件名称'</script>";3. Because this method is like the client pressing F5 to refresh the page, so When the page's method="post" is set, a "webpage expired" prompt will appear. That's because of Session's security protection mechanism. 4, or enter the html code:
<input type="button" onclick="dlink()" value="点击刷新" />JS代码:<script>
##5, function dlink(){document.location.href ="Current page file name";}
6. We need to reload the page, which means we expect the page to be reloaded on the server. Create, we expect is Not IsPostback. Here,
location.replace() can complete this task. The replaced page is regenerated on the server every time.
7. When the data processing page is accessed for the last time,
$_POST['title'],$_POST['num] should be empty values. So if you add a judgment, it must have a specific value, and then perform SQL operations.
PHP programming from entry to proficiency
The above is the detailed content of How to set up to turn off page refresh in php?. For more information, please follow other related articles on the PHP Chinese website!