Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

refresh

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?

like image 918
omg Avatar asked Nov 22 '25 21:11

omg


1 Answers

This should work, in PHP:

header('Refresh: 3; url=index.php');
like image 80
George Claghorn Avatar answered Nov 25 '25 11:11

George Claghorn