Method of Realizing Timing Jump on PHP Page

  • 2021-07-22 09:21:25
  • OfStack

This article describes the example of PHP page to achieve timing jump method, to share for your reference. The specific implementation method is as follows:

php Timing Jump We need to use header function to input html or js code to realize timing jump. Let me introduce a simple example below

The php code is as follows:

header("refresh:3;url=https://www.ofstack.com");
print(' Loading, please wait ...<br>3 Automatically jump to script home after seconds ~~~');

The output html code is
<meta http-equiv="refresh" content="3; url=https://www.ofstack.com">
1-like effect.
In this way, it automatically jumps to https://www.ofstack.com after 3 seconds.

Note here: If your file is uft-8 encoded, we should be careful not to have output or BOM characters before header, which may lead to no jump.

I hope this article is helpful to everyone's PHP programming.


Related articles: