Search code examples
phprefresh

how to switch to another page in 3 seconds in PHP?


Here is my try:

@header("Content-type: text/html; charset=utf-8");
@header("Location:/index.php");
@header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past

As you have seen,there is no control over "3 seconds",how to make it take effect in 3 seconds?


Solution

  • This should work, in PHP:

    header('Refresh: 3; url=index.php');