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)
indeed you can use this code as teneff said, but you don't have to necessarily put the header before any sent output (this would output a "cannot relocate header.... :3 error").
To solve this use the php function ob_start(); before any html is outputed.
To terminate the ob just put ob_end_flush(); after you don't have any html output.
The PHP refresh after 5 seconds didn't work for me when opening a Save As dialogue to save a file:
(header('Content-type: text/plain');
header("Content-Disposition: attachment; filename=$filename>");)
After the Save As link was clicked, and file was saved, the timed refresh stopped on the calling page.
However, thank you very much, ibu's javascript solution just kept on ticking and refreshing my webpage, which is what I needed for my specific application. So thank you ibu for posting javascript solution to php problem here.
You can use javascript to redirect after some time