forumnz Posted January 28, 2008 Share Posted January 28, 2008 I have sessions working on my site - all fine. I call a menu from the root level on the homepage by including menu.php and on /SecondLevel by calling ../menu.php. The menu checks if session is set, and if it is then it displays Logout, and if not, it displays Login. Problem is, on my homepage it works fine, but on my /SecondLevel it displays Login instead of Logout. Hope that makes sense - anyone know why? Here is the menu code snippet for reference: <?php if(!isset($_SESSION['SESS_MEMBER_ID']) || $_SESSION['SESS_LEVEL_ID'] != '1'){ echo "<a class=\"one\" href=\"/Login.php\">Sign in</a>"; } else { echo "<a class=\"one\" href=\"/Logout.php\">Logout</a>";}?> Quote Link to comment https://forums.phpfreaks.com/topic/88147-solved-session/ Share on other sites More sharing options...
mmarif4u Posted January 28, 2008 Share Posted January 28, 2008 Did u put session_start at the second level. Quote Link to comment https://forums.phpfreaks.com/topic/88147-solved-session/#findComment-450983 Share on other sites More sharing options...
forumnz Posted January 28, 2008 Author Share Posted January 28, 2008 What do you mean? You mean at the top of the page just <?php session_start; ?> What would that do? Quote Link to comment https://forums.phpfreaks.com/topic/88147-solved-session/#findComment-450986 Share on other sites More sharing options...
me1000 Posted January 28, 2008 Share Posted January 28, 2008 session_start(); Quote Link to comment https://forums.phpfreaks.com/topic/88147-solved-session/#findComment-450987 Share on other sites More sharing options...
mmarif4u Posted January 28, 2008 Share Posted January 28, 2008 I mean put session_start(); in your homepage. I think you already put it there. Can you show your code snappiest. Quote Link to comment https://forums.phpfreaks.com/topic/88147-solved-session/#findComment-450989 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.