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. Quote Link to comment 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 Quote Link to comment 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.. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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] Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.