I’m calling $_SERVER[“REMOTE_ADDR”] and it returns ‘::1’
Any ideas why am I getting this strange output? How to get a proper ip?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
::1is the IPv6 equivalent of127.0.0.1which is the IP address of your local (loopback) interface.More information here: http://en.wikipedia.org/wiki/Localhost
You can disable IPv6 in your webserver to only serve IPv4 hosts. This way, you will only get propers IP adresses in
$_SERVER["REMOTE_ADDR"]