PHP Header Redirect? Don’t forget to die();
There are some instances where you might need to redirect from the page you are on. For example, the user needs to be logged in so whip them away to the login page.
In PHP, this can be done like so:
header("Location: http://www.mysite.com/login.php");
If you do employ this method, don’t forget that the script may continue executing after the user has gone. Always follow up your header redirects with a die();
header("Location: http://www.mysite.com/login.php");
die();
