Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the client's computer name

Tags:

php

I am getting the client's (website user's) IP address. Now I'd like to go one step further by knowing the user's computer name. So far, my research has not turned up anything to aid me in retrieving this information.

Is it possible to use the user's IP address, or some other means, to get my visitor's computer name using PHP?

like image 621
Anup Prakash Avatar asked Jun 09 '10 05:06

Anup Prakash


People also ask

What is a client hostname?

The client names consist of a prefix, or root name, plus a dash and a number assigned by the server. For example, if the root name is charlie, the client names are charlie-1, charlie-2, charlie-3, and so on. By default, generated client names begin with the name of the DHCP server that manages them.

How do I find my computer name in Internet Explorer?

Or client could open commandprompt and type "hostname" and hit enter. Or Start > Run > (Winkey+R) type: "cmd.exe /k hostname" and hit enter.


1 Answers

PHP 5.4+

gethostbyaddr($_SERVER['REMOTE_ADDR'])
like image 92
moeiscool Avatar answered Oct 05 '22 22:10

moeiscool