View Full Version : How to get PC name
patejl
04-20-2005, 09:01 AM
Hi, I would like to ask you if it is possible to check by PHP PC name somethig like GetHostByName. I can't validate users by IP because of their IP address is everyday different.
Regards
P.
Scrowler
04-20-2005, 02:03 PM
as far as i'm aware, PHP can't get your pc's name. gethostbyname() (http://php.net/gethostbyname) return the resolved ip of a webserver. the name is a different thing altogether.
i don't even think the computer name is transmitted... but you might have some luck with something like javascript or java
marek_mar
04-20-2005, 04:18 PM
You should make the users login. Checking anything else isn't really safe... if you (for what ever reason need it) get the servers name you can use $_ENV["COMPUTERNAME"].
Velox Letum
04-20-2005, 07:17 PM
Computer names are not unique to the computer, and no guarentee that it is truly the same person at the computer, nor is the IP address a valid way to ensure security. Dynamic IP addresses (56k) change with each reconnect.
The best way would be as marek suggested: a login. A nice tutorial can be found at http://biorust.com/index.php?page=tutorial_detail&tutid=115.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.