There are some instances where you want to redirect the user away from the current page. For example, the user needs to be logged in, so you want them redirected to the login page.
In PHP, this can be done like so:
If you employ this method, remember that the script will continue after the user has gone. Any code underneath this header() call will still be executed.
Therefore, you should always follow up your header redirects with a die(); or exit();