This article mainly introduces the PHP page to implement timed jump method, the example shows the use of the header function to achieve jump skills, the need for friends can refer to the next
The example of this article describes the PHP page to implement timed jump method, share for everyone to reference. The implementation method is as follows:
PHP timed jump We need to use the header function to input HTML or JS code to achieve timed jumps, let me introduce a simple example
The PHP code is as follows:
The code is as follows:
Header ("refresh:3;url=http://www.php.cn");
Print (' Loading, please wait ...<br> three seconds to automatically jump to topic.alibabacloud.com~~~ ');
The HTML code for the output is
The code is as follows:
<meta http-equiv= "Refresh" content= "3; Url=http://www.php.cn ">
The same effect.
This enables the automatic jump to http://www.php.cn after 3 seconds.
It is important to note that if your file is uft-8 encoded, we should be careful not to have output or BOM characters in front of the header, which can lead to the inability to jump.