Dev DOS
Dev DOS

Reputation: 1068

get the user of the computer with php

I'm trying to get the name of the user who access my webserver. I know how to get the name of the computer which is connected to the server:

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);  

and i'm looking for a way to get the user who is opened the session in the computer. Is there a way to do this?

Upvotes: 1

Views: 168

Answers (2)

Rajarshi Goswami
Rajarshi Goswami

Reputation: 356

Take a look at the AUTH_USER request variable. PS: It wont work unless you have LDAP/Active Directory and provided your server doesnot allow anoynimous login. If both seneriaos are OK, IE wil send over the user, normally might not work for other browsers

Similar question : Can you get a Windows (AD) username in PHP?

Upvotes: 0

deceze
deceze

Reputation: 522081

In one word: No.

You cannot reach into remote computers and pull out any kind of information you want. Thank god. So unless the username is voluntarily advertised by the remote computer as part of some protocol or another, you cannot get it. And the username is not typically disclosed as part of any regular HTTP protocol traffic.

Upvotes: 5

Related Questions