Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, how can php display windows logon username

Status
Not open for further replies.

GeeRob

IS-IT--Management
Nov 19, 2003
4
GB
running our intranet with php and would like to display the users logon name. PCs are running on windows 9x, 2000, xp.
i've tried

$ip =$_SERVER['PHP_AUTH_USER'];
echo &quot;<font>Your username is: $ip</font><br>&quot;;

and get nothing
i can display ip and computername but not username (windows or network)
can anyone come up with any suggestions?
Cheers
 
Hi Geerob,

PHP_USER_AUTH is a reserved variable which will contain a username entered by the user. Usually this is done via a username/password prompt (this is only available if you are using PHP with Apache and only if apache is installed as a module rather than a CGI).

I have tried searching on google and checked through the php manual but so far I cannot find an appropriate answer to your question.

Reference:

Toby Heywood
 
thanks Toby

php is running on Apache but users don't log on to Apache if they are logged on to the domain. i'm looking at domain username capture (maybe from the Reg???) but don't have enough php knowledge to do this

G
 
G,

OK First attempt wasn't so successful! However I think I may have found something which you can research more into to accomplish the desired outcome!

PHP & Win32 API

I have only glanced at this, although it may provide you with some valuable pointers, it suggests that development has ceased and therefore you may find that you are unable to do exactly what you had planned.

Anyway hope this helps!

Regards


Toby Heywood
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top