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"
LVL 1
paStiSSetAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ashooooCommented:
$machine_name = gethostbyaddr($_SERVER["REMOTE_ADDR"]);

Hope this helps
paStiSSetAuthor Commented:
nope, it gets the host
ashooooCommented:
Does it give the IP address?
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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?
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?
paStiSSetAuthor Commented:
so, obviously that's not what i want, thx
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.
ashooooCommented:
So much for trying to help people...
paStiSSetAuthor Commented:
it returns:
XX.XX.XX.XXX.proxycache.rima-tde.net

thats not what i want >:(
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.
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ashooooCommented:
True...
ashooooCommented:
Just out of curiousity, can you tell me how my answer was different from the one you accepted?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.