tags:

views:

96

answers:

5

After getting the client(Website user) IP address. Now i want to go one step ahead by knowing the Computer name of the user.

So, agian i need help from my question viewer to help me regarding computer name of the client(website user).

I tried it by myself using google. But at last i thought it is better to ask to all of you who have better and best answers.

Thanx again to see my query. And much much thanx for them who are answering this question.

+2  A: 

Not possible with plain php running on the server. It'd be a security/privacy issue to know details of the client such as computer name, mac address, contents of his drive.

You need some sort of application running on the client's machine in order to get this.

cherouvim
which type of application?
Anup Prakash
Exactly, I don't want to see his/her disk content or mac address. But i want to know just computer configuration(processor's GHz, Processor's name, RAM capacity) he/she is using(configuration) and the Operating System.
Anup Prakash
cherouvim
The operating system can be estimated via the http user agent string.
cherouvim
+2  A: 

If you're referring to the hostname (displayed for instance by the hostname command on linux) of the computer doing the request:

That information is not included in an HTTP request. (That is, it's impossible for PHP to figure out.)

You could do a reverse DNS lookup, but that's probably not what you want anyway.

aioobe
+1  A: 

You can perform a reverse DNS lookup using gethostbyaddr.

Note that this will give you the name of the host the request came from according to reverse DNS.

  • It will not give you a result if reverse DNS isn't set up
  • It will not give you the Windows name of the computer
  • It will give you the name of the router if NAT is involved or proxy if a proxy is involved.
David Dorward
A: 

The only thing you could do is try to get a DNS name for the client. "Computer Name" is a Windows made-up thing. Just call the built-in function gethostbyaddr() with the client's IP address. However, it won't always (hardly ever) work.

Eric Mickelsen
A: 

You can do this by

$_SERVER['REMOTE_HOST']

'REMOTE_HOST' - The Host name from which the user is viewing the current page. The reverse dns lookup is based off the REMOTE_ADDR of the user.

Note: Your web server must be configured to create this variable. For example in Apache you'll need HostnameLookups On inside httpd.conf for it to exist. As David mentioned you can also use . gethostbyaddr()

Pls go thru all the comments in the url before actually using the function.

nepsdotin
Yes! I saw it in php manual. but it doesn't work. So, do you have any other option to see the name of client computer.
Anup Prakash