dpkyte Posted February 20, 2006 Posted February 20, 2006 I am setting up a directory with WEB PROTECT. I want to build the page based on their userid entered. How can I grab the userid they enter? I have one Admin page, 6 different categories, based on their userid (usercat1, usercat2 ...) I want to filter the data they can access (cat1, cat2 ...) Thanks in advance. DPK Quote
TCH-JimE Posted February 21, 2006 Posted February 21, 2006 (edited) Hello DPK, I am guessing from having a think that you would either need to use a session ID or cookie. Jimuni Edited February 21, 2006 by Jimuni Quote
dpkyte Posted February 22, 2006 Author Posted February 22, 2006 I found the following to get the id: $_SERVER['PHP_AUTH_USER']. Issue now is logging out. I've tried session_start(); session_unset(); session_destroy(); but I found out PHP sessions won't have anything to do with .htaccess logins. So, any thoughts here? Quote
TCH-JimE Posted February 24, 2006 Posted February 24, 2006 Hello, Am i guessing correctley that you now wish to loose the session when the user closes thier window or moves to another website? Jimuni Quote
dpkyte Posted February 24, 2006 Author Posted February 24, 2006 Would like a button to execute to log out. That way they can log in with another userid if necessary. Quote
TCH-JimE Posted February 25, 2006 Posted February 25, 2006 Hello, Hmm the internet seems full of different ideas with everybody claiming that everyone elses doesnt work. Anyway, try this, save it as logout.php and call it by pressing the button: ><?php session_start(); // if the user is logged in, unset the session if (isset($_SESSION['PHP_AUTH_USER'])) { unset($_SESSION['PHP_AUTH_USER']); } if (isset($_SESSION['PHP_AUTH_PW'])) { unset($_SESSION['PHP_AUTH_PW']); } // now that the user is logged out, // go to login page or whatever header('Location: login.php'); ?> Jimuni Quote
dpkyte Posted March 6, 2006 Author Posted March 6, 2006 That did not seem to work either. Thanks though Quote
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.