Home>Article>Backend Development> How to implement timed jump in php header
php method to implement timed jump: first create a PHP file; then use the "header('Refresh: time value, Url=url page address');" code, for example "header('Refresh :3,Url=hello.php');" means the page will jump after 3 seconds.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
php header timing jump
header('Refresh:time,Url=url页面地址');
Example:
header('Refresh:3,Url=//m.sbmmt.com/'); //3s后跳转 echo '3s 后跳转'; //由于只是普通页面展示,提示的样式容易定制 die;
php header jumps to the page immediately
header('Location:url页面地址');
[Recommended learning: "PHP video tutorial》】
Note:
1. There cannot be a space between location and ":", otherwise an error will occur.
2. There cannot be any output before using the header.
3. The PHP code after the header will also be executed.
For more programming related knowledge, please visit:Programming Video! !
The above is the detailed content of How to implement timed jump in php header. For more information, please follow other related articles on the PHP Chinese website!