sws Posted November 11, 2006 Share Posted November 11, 2006 I have a page that requires a user to be logged in before they can view the page.I have written code that loads the page if they are logged in. In my else statement I need to know how to redirect the user to my login page. Can anybody please tell me how to do this ?Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/26959-redirecting-a-user-to-a-login-page/ Share on other sites More sharing options...
toplay Posted November 11, 2006 Share Posted November 11, 2006 Use:header('Location: http://www.example.com/login.php');exit;You can't send any output to the browser before issuing the header().hth. Link to comment https://forums.phpfreaks.com/topic/26959-redirecting-a-user-to-a-login-page/#findComment-123269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.