I was looking around today for ways to redirect the browser window, and I found a few interesting ones that may come in handy.
There is the standard way of sending the Header with a new location. This will immediately redirect the browser, meaning the redirect page is never seen. This can be a useful way for preventing unauthorized users from getting to a page you don’t want them to view (you should definately use die() or exit() to kill the script though, in case the redirect fails, and so that no data will be changed).
Header('Location:');
Note that Headers MUST be sent before any other data. Meaning that if you want to send headers it needs to be before any html or output (echo, printf ect).
The different, and more interesting, way that I discovered today is using Header to do a delayed redirect.
Header('refresh: 5, url="page.php"');
The number is the number of seconds before the refresh, and the url is the page you want to redirect to. This method will allow people view the content of the page before they are automatically redirected (to a download, away from a ‘Submission complete’ page ect).
