Deivas Posted March 7, 2010 Share Posted March 7, 2010 How come that if i do that at my homepage it prints out the username. if(isSet($_SESSION['username'])) { echo $_SESSION['username'];}else{ echo "lol"; } if I do that in another directory it prints out lol. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 7, 2010 Share Posted March 7, 2010 It will always echo out the username provided the session variable $_SESSION['username'] exits. Whenever working with sessions always add session_start at the top of every page. You probably didn't do this in your "other directory" that is what it doesn't display the username. Quote Link to comment Share on other sites More sharing options...
Deivas Posted March 7, 2010 Author Share Posted March 7, 2010 Ok thanks I knew it but I forgot about it Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.