I write the following script to show me the host IP but its isn’t working.
I’m using XAMPP on windows 7.
<?php
//Gets the IP address
$ip = getenv("REMOTE_ADDR") ;
Echo "Your IP is " . $ip;
?>
It always shows Your IP is ::1 .
Totally unexpected how should I fix it ?
::1and127.0.0.1are both ip addresses of your local machine.