dean7 Posted July 17, 2009 Share Posted July 17, 2009 Hi, i have a login script witch works fully but i have a problem, when a user is not logged and they put index2.php at end of the url it takes them to the main part of my website but if i want it so they have to login how would i make it? Thanks for your help Link to comment https://forums.phpfreaks.com/topic/166321-need-to-be-logged-in-to-veiw/ Share on other sites More sharing options...
timmah1 Posted July 17, 2009 Share Posted July 17, 2009 My login script sets a session like $_SESSION['SESS_LOGGEDIN'] = 1; once the person is logged in. Then on the top of my pages that I want to make sure they are logged in first, I put this: if(isset($_SESSION['SESS_LOGGEDIN]) == FALSE){ header("Location: " . $config_basedir . "login.php?error=1"); } Link to comment https://forums.phpfreaks.com/topic/166321-need-to-be-logged-in-to-veiw/#findComment-877082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.