jimfog Posted October 11, 2012 Share Posted October 11, 2012 I am trying to get the client IP using the following code: $ip=$_SERVER['REMOTE_ADDR'];echo "<b>IP Address= $ip</b>"; The only the gets printed to the browser though is this:IP Address=::1 I am developing locally and as such the IP is 127.0.0.1-I believe this is that should beprinted in the browser. Link to comment Share on other sites More sharing options...
Don E Posted October 11, 2012 Share Posted October 11, 2012 Yes that is why you're seeing that because of developing locally. Try making your server accessible from outside connections, then using another ISP, like a friends or cafe... or your mobile phone if you have one using the carriers connection(not wifi because it may connect to your local home wireless connection if you have one), you should see the actual IP address when using the above. Link to comment Share on other sites More sharing options...
jimfog Posted October 11, 2012 Author Share Posted October 11, 2012 Is there a way that I can bypass the problem and the local IP be printed in the browser. I am not doing it for experimentation purposes-I am developing an application in whichthe IP of the client has to be inserted into a table. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 11, 2012 Share Posted October 11, 2012 ::1 is the IPv6 equivalent of 127.0.0.1 for IPv4, they are both loopback IPs that point to your machine. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now