A
Anonymous
Guest
The reason it is returning the ip address is because that is what the function does... returns the ip address. If you want the actual hostname you need to use gethostbyaddr()
$r_hostname = gethostbyaddr($REMOTE_ADDR);
if ($REMOTE_ADDR == "$r_hostname") {
....
}
In some situation than used virtual host or dynamic IP you get not correct IP or not get IP actually :?greg said:I simply use:
$ipaddress = getenv("REMOTE_ADDR");
and then echo it out or store it in a database or whatever.