Home >Backend Development >PHP Problem >How to make a php page jump after a few seconds

How to make a php page jump after a few seconds

coldplay.xixi
coldplay.xixiOriginal
2020-10-05 13:35:512433browse

How to jump to the PHP page after a few seconds: Use the header function to enter the HTML or JS code to realize the scheduled jump. The code is [header("refresh:3;url=//www.php.cn ");print('Loading, please wait...].

How to make a php page jump after a few seconds

How to jump to the php page after a few seconds:

php timing jump we need to use header functionEnter html or js code to achieve timing jump, let me introduce a simple example

php code As follows:

header("refresh:3;url=//www.php.cn");
print('正在加载,请稍等...
三秒后自动跳转到PHP中文网~~~');

The output html code has the same effect as below.

<meta http-equiv="refresh" content="3;url=//www.php.cn">

This achieves automatic jump after 3 seconds.

Needed here Note: If your file is uft-8 encoded, we must be careful not to have output or BOM characters before the header, which may result in failure to jump.

Want to know more For more programming learning, please pay attention to the php training column!

The above is the detailed content of How to make a php page jump after a few seconds. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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