Jump to content

$_server['remote_addr'] Returns A Private Address. Why?


NamemeNick

Recommended Posts

for the past 3 weeks, I've used $_SERVER['REMOTE_ADDR']) to access the visitor's IP address without problems. Today, it returns the incorrect 192.168.151.35 (this is a private address ie behind router I think). I have no idea why this is happening, as I know that is not my IP address (www.whatismyip.com shows correct IP).

 

Please check out whether my page reads your address correctly and let me know at www.gmatfix.com/demo

 

Under what condition can $_SERVER['REMOTE_ADDR']) return an incorrect IP? How can I fix it?

 

Thank you

"192.168.151.35" is the form for a local address as you said, and I receive the same ip address listing when I visit your website.

 

If the request goes through a router, the remote address could be the router's address. Try to find a setting in your router that specifies whether it passes along the IP of the person who made the request. If it's not the router's fault, try figuring out which computer on your network this IP belongs to.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.