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

Link to comment
Share on other sites

"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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.