sasha Posted September 2, 2006 Share Posted September 2, 2006 Hello.I ma fighting with one problem for about 2 weeks and cannot find any solvation.I build a site which gonna run in a private ,domain based network, and I need a script in php which will retrieve the username of the corrent logged on to windows user.Hope that you can help.Thank you, sasha. Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/ Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 seehttp://www.phpfreaks.com/forums/index.php/topic,105378.msg420967.html#msg420967 Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/#findComment-84931 Share on other sites More sharing options...
sasha Posted September 3, 2006 Author Share Posted September 3, 2006 thank you, but I need the current windows logged in information.. Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/#findComment-85063 Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 Last time I used it, that's what it gave - the username of logged on windows user. Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/#findComment-85065 Share on other sites More sharing options...
zq29 Posted September 3, 2006 Share Posted September 3, 2006 Surely that would only display the user logged onto the server though wouldn't it? Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/#findComment-85075 Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 Gives the username of the user currently running the script.[code]<?php$domuser = $_SERVER['LOGON_USER'];list ($domain, $username) = explode ('\\', $domuser); // use '\\\\' on some serversecho "Your username is $username";?>[/code] Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/#findComment-85078 Share on other sites More sharing options...
sasha Posted September 3, 2006 Author Share Posted September 3, 2006 I get an empy value from the function: $_SERVER['LOGON_USER'];maybe I should install any module or enable any options in httpd\php ?I am running Apache 1.3 Win32 on winxp. Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/#findComment-85080 Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 I've only used it with IIS and, as I stated in the other thread, anonymous access needs to be disabled or it too gives a blank value. Link to comment https://forums.phpfreaks.com/topic/19525-how-to-retrieve-windows-logged-on-user-information/#findComment-85084 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.