How to set up to turn off page refresh in php?

coldplay.xixi
Release: 2023-03-02 17:20:01
Original
2758 people have browsed it

php set the method to turn off page refresh: first use the [location.reload()] function; then enter the html code [JS code: <script>】</script>

How to set up to turn off page refresh in php?

##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.

How to set up to turn off page refresh in php?

2. Enter

<?phpecho "<script type=&#39;text/javascript&#39;>document.location.href=&#39;当前页面文件名称&#39;</script>";
Copy after login

How to set up to turn off page refresh in php?

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.

How to set up to turn off page refresh in php?

4, or enter the html code:

<input type="button" onclick="dlink()" value="点击刷新" />JS代码:<script>
Copy after login

How to set up to turn off page refresh in php?##5, function dlink(){document.location.href ="Current page file name";}

How to set up to turn off page refresh in php?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.

How to set up to turn off page refresh in php?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.

How to set up to turn off page refresh in php?

Related learning recommendations:
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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template