How to achieve page jump in 3 seconds in php: 1. Use the "header('Refresh:3,Url=page address')" statement; 2. Use "echo "";" statement.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
php achieves 3 seconds How to jump to the page
1. Use Header function
<?php header("Content-type:text/html;charset=utf-8"); header('Refresh:3,Url=http://www.php.cn/'); //3s后跳转 echo '3s 后跳转'; //由于只是普通页面展示,提示的样式容易定制 die; ?>
2. Use echo outputs meta
<?php header("Content-type:text/html;charset=utf-8"); echo '3s 后跳转'; echo "<meta http-equiv='refresh' content='3; url=http://www.php.cn'>"; die; ?>
Note that the number 3 in the content means how long it will take to start jumping. The setting here is 3, which means it will take It will take 3 seconds for the page to jump to the target page. It is recommended that you set the jump time not to exceed 10 seconds.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to achieve page jump in 3 seconds in php. For more information, please follow other related articles on the PHP Chinese website!