smartguyin Posted July 22, 2006 Share Posted July 22, 2006 The website has login system but some pages can be accessable without login and some pages like logging to control panel or adding post for which logging in is compulsory....Or for the pages where loggin in is not compulsory.... means people can see the content without loggin in i am using the [b]include "user.inc.php";[/b] in those pages.... And pages like control panel and adding post is compulsory i am using [b]inlcude "auth_user.inc.php";[/b] Soo that if the user is not logged in they will be directed to user_login.php page to LOG IN.MY PROBLEM >>>>>>>>>> I am using sidebar.php page for my side column.... When the User is logged in, it shows the logged in username in side bar using "$_SESSION['user_logged']" in sidebar.php page and some links to control panel....... NOW when the user is acually logged in.... the sidebar shows the name of the username logged in where i am using user.inc.php but it doesn't shows the username of logged in user in control panel and add post page where i am using auth_user.inc.php....... Please help me to find out why am i not able to see the username in sidebar when i am using auth_user.inc.php or while loggin into control panel....auth_user.inc.php >>>>>>>>> page[code]<?phpsession_start();if ((isset($_SESSION['user_logged']) && $_SESSION['user_logged'] != "") ||(isset($_SESSION['user_password']) && $_SESSION['user_password'] != "")) {$name = ($_SESSION['user_logged']);session_register($_SESSION['user_logged']);$name = $_SESSION['user_logged'];$side = 1;} else {$side = 0;$redirect = $_SERVER['PHP_SELF'];header("Refresh: 5; URL=http://localhost/est/login/user_login.php");echo "You are not currently no logged in, we are redirecting you, be patient!<br>";echo "(If your browser doesn't support this <a href=\"http://localhost/est/login/user_login.php\">Click Here</a>)";die();}?>[/code]My user.inc.php >>>>>>>>>>>>>.page[code]<?phpsession_start();if ((isset($_SESSION['user_logged']) && $_SESSION['user_logged'] != "") ||(isset($_SESSION['user_password']) && $_SESSION['user_password'] != "")) {$side = 1;} else {$side = 0;//do nothing}?>[/code] Quote Link to comment Share on other sites More sharing options...
shocker-z Posted July 22, 2006 Share Posted July 22, 2006 I've read thru your post about 3 times but i'm still not quite getting what your exact problem is and also your code$name = ($_SESSION['user_logged']);session_register($_SESSION['user_logged']);$name = $_SESSION['user_logged'];why are you setting it before and after session_register?andif ((isset($_SESSION['user_logged']) && $_SESSION['user_logged'] != "") ||(isset($_SESSION['user_password']) && $_SESSION['user_password'] != "")) {shouldn't that beif ((isset($_SESSION['user_logged'])) && ($_SESSION['user_logged'] != "")) || ((isset($_SESSION['user_password'])) && ($_SESSION['user_password'] != ""))) {RegardsLiam 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.