Home > Article > Backend Development > PHP implements a jump statement after staying for a few seconds
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.
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('正在加载,请稍等...<br>五秒后自动跳转。'); ?>
Method 2:
<script language="JavaScript"> function myrefresh(){ window.location.href="<?php echo $url_web ?>"; } setTimeout('myrefresh()',3000); //指定3秒转跳 </script>
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!