Getting Users Real IP address using PHP

前端 未结 5 997
刺人心
刺人心 2020-12-06 15:39

I want to get the real IP address from users going on my site even if they use a proxy website like hidemyass.com

This is the code I have and thought it worked but I

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 15:49

    You can't. The info you have is from apache/iis/whatever, and it only knows who is talking to your server, which in this case, is the proxy. Unless the proxy wants to send along that info in a header, then you won't get it.

    X-Forwarded-For is the best you can do, but its not likely an anonymous proxy will send that.

提交回复
热议问题