I’m trying to create a PHP script for my homework.
I need the script to log ip addresses for security reasons.
For some reason, when I run the following code:
echo $_SERVER['REMOTE_ADDR'];
The result is :
::1
I thought a localhost ip address was always like 127.0.0.1 ?
Does anyone know what is happening ? This is really bugging me and I can’t seem to find a solution to the problem. Even google doesn’t find anything related…
I should mention that I’m running an XAMPP installation on a windows 7 64bit machine.
Thanks in advance.
On Windows 7 localhost resolves to ::1 which is the ipv6 representation of 127.0.0.1
if you also need mysql connection, it will help you to speed up the connection.