• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 731
  • Last Modified:

How to get the machine name who visits the file.php

well, i need to know how i must do to get the Machine Name from the visitor

for ex: my pc name is Icarus

the php will print "Icarus"
0
paStiSSet
Asked:
paStiSSet
  • 8
  • 4
1 Solution
 
ashooooCommented:
$machine_name = gethostbyaddr($_SERVER["REMOTE_ADDR"]);

Hope this helps
0
 
paStiSSetAuthor Commented:
nope, it gets the host
0
 
ashooooCommented:
Does it give the IP address?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
paStiSSetAuthor Commented:
i don't want the ip address, im askin for a scipt wich prints the machine name.
machine name means the PC name (lan pc name), ok?
0
 
ashooooCommented:
Thats what I am saying... gethostbyaddr($_SERVER["REMOTE_ADDR"]); does just that. Unless ofcourse there is no hostname for the particular IP address. OK?
0
 
paStiSSetAuthor Commented:
so, obviously that's not what i want, thx
0
 
ashooooCommented:
Do you mean to say that gethostbyaddr DOES NOT give you the machine name? Tell me that I'm a fool for using the function all this time in my scripts.
0
 
ashooooCommented:
So much for trying to help people...
0
 
paStiSSetAuthor Commented:
it returns:
XX.XX.XX.XXX.proxycache.rima-tde.net

thats not what i want >:(
0
 
ashooooCommented:
It depends on how your website is accessed by the remote client. If he/she accesses it over the internet (using http://www.remotehost.com) then, you get the above name. If he/she accesses it using http://intranetname, then you get the actual machine name.

It all depends on how your server recognizes the remote machine.
0
 
m0nk3yCommented:
and to add to the previous comment, i dont' think it's possible to get the machine name if the domain is the internet; it's a security feature (not of php, of the client). You could of course, get the ip of the machine and then do some crazy ping/lookup or something liket that, but if it's going through a router or a proxy i doubt that would work either.
0
 
ashooooCommented:
True...
0
 
ashooooCommented:
Just out of curiousity, can you tell me how my answer was different from the one you accepted?
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 8
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now