sergeyba Posted August 12, 2007 Share Posted August 12, 2007 Hello to all. i am using apache,mysql and php on windows XP and soon wil move to windows server 2003, need something that will work on both. i need some kind of script that will get me the current clients windows username. i dont really care what language it will be written. all i need is that it will be possible to embbed it into php page without any extra modules if possible, if not then with some kind of module that is free. (how to embbed it as well will be more than welcome) thank you very much all. please i need it as fast as i can. Quote Link to comment https://forums.phpfreaks.com/topic/64542-windows-username-please-help/ Share on other sites More sharing options...
cooldude832 Posted August 12, 2007 Share Posted August 12, 2007 this is really a asp or asp.net sorta function hwoever I belive it can be done using the exec() command Quote Link to comment https://forums.phpfreaks.com/topic/64542-windows-username-please-help/#findComment-321719 Share on other sites More sharing options...
Barand Posted August 12, 2007 Share Posted August 12, 2007 I haven't tried this with Apache, only on a windows network with IIS, but $domainUser = $_SERVER['LOGON_USER']; //--> domain\username or domain\\username (version?) list ($domain,$username) = explode ('\\', $domainUser); // or explode ('\\\\', $domainUser); echo $username; For this to work with IIS, the folder containing the script must not allow anonymous access. Quote Link to comment https://forums.phpfreaks.com/topic/64542-windows-username-please-help/#findComment-321761 Share on other sites More sharing options...
sergeyba Posted August 14, 2007 Author Share Posted August 14, 2007 Thanks guys. But Still No Luck, some other way? Quote Link to comment https://forums.phpfreaks.com/topic/64542-windows-username-please-help/#findComment-323642 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.