Link to home
Start Free TrialLog in
Avatar of paStiSSet
paStiSSet

asked on

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"
Avatar of ashoooo
ashoooo

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

Hope this helps
Avatar of paStiSSet

ASKER

nope, it gets the host
Does it give the IP address?
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?
Thats what I am saying... gethostbyaddr($_SERVER["REMOTE_ADDR"]); does just that. Unless ofcourse there is no hostname for the particular IP address. OK?
so, obviously that's not what i want, thx
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.
So much for trying to help people...
it returns:
XX.XX.XX.XXX.proxycache.rima-tde.net

thats not what i want >:(
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.
ASKER CERTIFIED SOLUTION
Avatar of m0nk3y
m0nk3y

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
True...
Just out of curiousity, can you tell me how my answer was different from the one you accepted?