Home >Backend Development >PHP Problem >How to jump after staying for a few seconds in php
How to jump after staying for a few seconds in php: 1. Use "header("refresh:5;url=...");" to jump after staying for a few seconds; 2. Use "header("refresh:5;url=...");" setTimeout('myrefresh()',3000);" can be used to stay for a few seconds and then jump.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
Stay in php for a few seconds and then jump Statement
Method one:
<?php header("refresh:5;url=http://www.XXXXX.com"); print('正在加载,请稍等...<br>五秒后自动跳转。'); ?>
Method two:
<script language="JavaScript"> function myrefresh(){ window.location.href="<?php echo $url_web ?>"; } setTimeout('myrefresh()',3000); //指定3秒转跳 </script>
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to jump after staying for a few seconds in php. For more information, please follow other related articles on the PHP Chinese website!