Home > Backend Development > PHP Problem > How to implement timed jump in php header

How to implement timed jump in php header

青灯夜游
Release: 2023-03-08 10:20:01
Original
2394 people have browsed it

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.

How to implement timed jump in php header

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

php header timing jump

header('Refresh:time,Url=url页面地址');
Copy after login

Example:

header('Refresh:3,Url=http://www.php.cn/');   //3s后跳转
echo '3s 后跳转';
//由于只是普通页面展示,提示的样式容易定制
die;
Copy after login

php header jumps to the page immediately

header('Location:url页面地址');
Copy after login

[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!

Related labels:
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