Possible Duplicate:
should $ip=$_SERVER['REMOTE_ADDR']; return ::1 on a mamp localhost?
I am trying to get the IP address of the website visitor in PHP. I'm expecting $_SERVER['REMOTE_HOST'] to return something like 127.0.0.1, but it's returning ::1.
::1 is the IPv6 equivalent of 127.0.0.1 - see http://www.juniper.net/techpubs/software/erx/erx50x/swconfig-routing-vol1/html/ipv6-config5.html The long form of that is
0:0:0:0:0:0:0:1 - but the :: stands in for the run of 0's.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With