Getting IP address from user

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()
 
Code:
$r_hostname = gethostbyaddr($REMOTE_ADDR); 
if ($REMOTE_ADDR == "$r_hostname") { 
    .... 
}
 
I simply use:

$ipaddress = getenv("REMOTE_ADDR");

and then echo it out or store it in a database or whatever.

[/code]
 
greg said:
I simply use:
$ipaddress = getenv("REMOTE_ADDR");
and then echo it out or store it in a database or whatever.
In some situation than used virtual host or dynamic IP you get not correct IP or not get IP actually :?
 
Back
Top