Home > Backend Development > PHP Problem > PHP implements a jump statement after staying for a few seconds

PHP implements a jump statement after staying for a few seconds

藏色散人
Release: 2023-03-02 14:22:02
Original
2537 people have browsed it

How to jump after a few seconds in php: 1. Use the "header("refresh:5;url=http://www.XXXXX.com");" method to jump; 2. Through The "setTimeout('myrefresh()',3000);" method implements a jump after 3 seconds.

PHP implements a jump statement after staying for a few seconds

Stay in php for a few seconds and then jump to the statement

Method 1:

<?php
header("refresh:5;url=http://www.XXXXX.com");
print(&#39;正在加载,请稍等...<br>五秒后自动跳转。&#39;);
?>
Copy after login

Method 2:

 <script language="JavaScript">
function myrefresh(){
window.location.href="<?php echo $url_web ?>";
}
setTimeout(&#39;myrefresh()&#39;,3000); //指定3秒转跳
</script>
Copy after login

For more related knowledge, please visit PHP Chinese website!

The above is the detailed content of PHP implements a jump statement after staying for a few seconds. 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