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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP on Intranet

Status
Not open for further replies.

bdichiara

Programmer
Oct 11, 2006
206
US
Is it possible to get any details about an IP address when PHP is used on a Windows IIS server? I would really like to find out the username of the currently logged on user. So when they access the intranet site, I can already tell what user is logged on, rather than setting up a separate login system. I'd also like to know if there is any other information I can obtain from the user's computer that might help me.

_______________
_brian.
 
It has nothing to do with ASP. It's pure PHP.

Code:
        $user = getenv("REMOTE_USER");

This assumes the visitor had to log into the directory where the script is stored.
 
I think we've both jumped to conclusions about the nature of the client machine on the intranet... I'm thinking the OP wants WINS/NTID information from a Microsoft network, you're thinking .htaccess authentication... right?

D.E.R. Management - IT Project Management Consulting
 
I suspect that PHP will give a nice interface to either situation via getenv. Not 100% sure. Let's get more info (and maybe let bdichiara actually try) before we hash this any more.
 
Yeah, i meant to post this earlier, but I've tried:

getenv("REMOTE_USER");
$_SERVER['REMOTE_USER'];
$_SERVER['LOGON_USER'];
$_SERVER['AUTH_USER'];

I think i might've tried some others as well, however it seems that these all are associated with the PHP Authentication, not the Windows one. I'd rather not require them to login...

Thanks for helpin me out.

_______________
_brian.
 
Have you tried dumping the whole $_SERVER array? You've probably hit the high points, however.
 
Ok, I tried that, and it didn't seem to spit out anything useful. Only the IP but there's not much I can do with that? Any other ideas? Any alternate ways besides PHP?

_______________
_brian.
 
You might have to resort to ASP, since it's looking like you need a Windows specific function.

Other than that, does this help any? I don't know if it will give you the actual user name or just the name of your company, but it's worth a shot.
 
have you looked at windows integrated authentication in IIS? I believe this will work with IE clients but am not sure about the others.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top