divinedesigns1 Posted July 24, 2012 Share Posted July 24, 2012 first timer, im trying to make this code switch from login to logout when someone log onto the websitethis is how it is set up <?phpif(isset($_SESSION['uid'])){?> <a href="logout.php">Log Out</a> <?php}else{?> <a href="login.php">Log In</a> <?php}?> i have at the very top session_start(); inside of an opening and closing php tags then the html texts, and inside of a table thats where i have the above code so when i log in it redirect me to the index page and then it changes to logout, but it doesnt it keeps login not what i want to happen does anyone see anything wrong here? Link to comment Share on other sites More sharing options...
Ingolme Posted July 24, 2012 Share Posted July 24, 2012 It sounds like $_SESSION['uid'] isn't set. Remember, also, that session_start() needs to be on every single page. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted July 24, 2012 Author Share Posted July 24, 2012 It sounds like $_SESSION['uid'] isn't set. Remember, also, that session_start() needs to be on every single page.yeah i set it on the login page also ill check it out on the login page see whats going on there, thanks foxy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now