Page redirect after certain time PHP
header( "refresh:5;url=wherever.php" );
this is the php way to set header
which will redirect you to wherever.php
in 5 seconds
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file. (source php.net)
PHP redirect after 5 seconds
Use header Refresh.
It is simple:
header("Refresh:5; url=register.php");
It should work, make sure no output is before this header.
Redirect with Timer in PHP?
You can cause your PHP script to sleep for 10 seconds,
sleep(10);
but this will appear to the end-user as a non-responsive server. The best option is to use either a meta refresh,
<meta http-equiv="refresh" content="10;url=http://google.com">
or javascript.
setTimeout(function(){
window.location = "http://google.com";
}, 10000);
Found in the comments from Daniel:
header('Refresh: 10; URL=http://yoursite.com/page.php');
would be ideal for this situation, as it requires no Javascript or HTML.
How to Redirect Page in PHP after a few seconds without meta http-equiv=REFRESH CONTENT=time
Try use "refresh" header:
header('Refresh: 3;url=page.php');
Also, you can look at this Question Refresh HTTP Header.
Redirect website after specified amount of time
<meta http-equiv="refresh" content="3;url=http://www.google.com/" />
Related Topics
How to Find the PHP.Ini For PHP-Cli
What Exactly Is Path_Info in PHP
Find Out How PHP Is Running on Server (Cgi or Fastcgi or Mod_PHP)
PHP Regex: How to Match \R and \N Without Using [\R\N]
How to Relax PHP'S Open_Basedir Restriction
Associative Array, Sum Values of the Same Key
Composer Error: "PHP Extension Fileinfo Is Missing from Your System"
Get Entire Url, Including Query String and Anchor
Fatal Error: Call to Undefined Function MySQLi_Result()
Convert String into Slug With Single-Hyphen Delimiters Only
Set Pdo to Throw Exceptions by Default
Multidimensional Array Iteration
Print_R() Adds Properties to Datetime Objects
How to Extract a Node Attribute from Xml Using PHP'S Dom Parser
How to Successfully Rewrite Old MySQL-PHP Code With Deprecated MySQL_* Functions