Jump to content

Archived

This topic is now archived and is closed to further replies.

sasha

How to retrieve windows logged on user information?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
see
http://www.phpfreaks.com/forums/index.php/topic,105378.msg420967.html#msg420967

Share this post


Link to post
Share on other sites
Last time I used it, that's what it gave - the username of logged on windows user.

Share this post


Link to post
Share on other sites
Surely that would only display the user logged onto the server though wouldn't it?

Share this post


Link to post
Share on other sites
Gives the username of the user currently running the script.
[code]<?php
$domuser = $_SERVER['LOGON_USER'];
list ($domain, $username) = explode ('\\', $domuser);  // use '\\\\' on some servers

echo "Your username is $username";
?>[/code]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.