Search code examples
phphttp-redirectheaderrefreshmeta-tags

How to Redirect Page in PHP after a few seconds without meta http-equiv=REFRESH CONTENT=time


It seems that it is not advisable to use

<meta http-equiv=REFRESH CONTENT=3;url=url>

for redirects but instead use

header('Location: url')

However, I would like to show the user some message and allow them some time to read it before redirecting. Is there a way to do it without meta?


Solution

  • Try use "refresh" header:

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

    Also, you can look at this Question Refresh HTTP Header.