yasirbc Posted December 21, 2006 Share Posted December 21, 2006 Hi, I've recently started making web pages with PHP on an Apache server. I'm trying to log the User name of the currently logged in user. How do I access the User name from PHP. I'm using basic .htaccess to secure pages for now. Thanks for any and all help. Link to comment https://forums.phpfreaks.com/topic/31487-solved-solved-how-to-get-logged-in-user-info/ Share on other sites More sharing options...
Chronos Posted December 21, 2006 Share Posted December 21, 2006 Depens on what kind of logon system you use. There are serveral:-Cookies (Mostly used to auto-register the sessions)-Sessions-SQl-HTACCESSIn you're case, you are loggin ppl in with HTACCESS, thats fine for now but i suggest you to begin learning SQL database structures.As for now, Retrieving the username is simple:[code]$v_username = $_SERVER['PHP_AUTH_USER'];[/code] Link to comment https://forums.phpfreaks.com/topic/31487-solved-solved-how-to-get-logged-in-user-info/#findComment-145849 Share on other sites More sharing options...
yasirbc Posted December 21, 2006 Author Share Posted December 21, 2006 Hi, Thanks for the quick help. Works Great. :) It's just an internal intranet site so security isnt a major concern, but I'll look into using SQL for Authentication. Link to comment https://forums.phpfreaks.com/topic/31487-solved-solved-how-to-get-logged-in-user-info/#findComment-145871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.