eugene2009 Posted January 20, 2010 Share Posted January 20, 2010 parts of my website have directory passwords that are protected by my hosting provider. i have 12 different user accounts.. when different people login.. how can I retrieve the username and have it printed for example in the corner.. "now logged in as $username" does anyone know what im talking about? Quote Link to comment https://forums.phpfreaks.com/topic/189197-help/ Share on other sites More sharing options...
will35010 Posted January 20, 2010 Share Posted January 20, 2010 Are you using htaccess or a php script for logging in? Quote Link to comment https://forums.phpfreaks.com/topic/189197-help/#findComment-998848 Share on other sites More sharing options...
wildteen88 Posted January 20, 2010 Share Posted January 20, 2010 No not really. How are authenticating your users at the moment? Quote Link to comment https://forums.phpfreaks.com/topic/189197-help/#findComment-998849 Share on other sites More sharing options...
eugene2009 Posted January 20, 2010 Author Share Posted January 20, 2010 i dont have user accounts on my site for everyone.. just for the restricted areas.. all i did was click "password protect this directory" option.. sorry.. im not familiar with authentication. . Quote Link to comment https://forums.phpfreaks.com/topic/189197-help/#findComment-998853 Share on other sites More sharing options...
wildteen88 Posted January 20, 2010 Share Posted January 20, 2010 From what you're saying I think you're using basic HTTP authentication for your password protected directories, you could try the $_SERVER['PHP_AUTH_USER'] variable to retrieve the username. Eg echo $_SERVER['PHP_AUTH_USER']; Quote Link to comment https://forums.phpfreaks.com/topic/189197-help/#findComment-998856 Share on other sites More sharing options...
eugene2009 Posted January 20, 2010 Author Share Posted January 20, 2010 that worked! thanks!!! Quote Link to comment https://forums.phpfreaks.com/topic/189197-help/#findComment-998866 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.