PHP $ _SERVER ['REMOTE_ADDR']每次都提供不同的IP

时间:2018-08-03 05:30:34

标签: php ip

我正在使用Php superglobal <div data-container="" class="page-container" style="height: 92.5%;"> <div id="b3-b2-ContentPlaceholder" style="background-color: #cecece;"> <div style=""> <span data-expression="" style="">Some super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text hereSome super long text here</span> </div> <div data-container="" class="yes-no-buttons-container"> <div> <div data-container="" class=""> <button data-button="" type="button" style="width: 49%;"> <span data-expression="">Yes</span> </button> <button data-button="" type="button" style="width: 49%; margin-left: 1%;"> <span data-expression="">No</span> </button> </div> </div> </div> </div> </div>来获取客户端ip。但是它总是为我提供不同的IP地址,而且$_SERVER['REMOTE_ADDR']提供的IP地址也不正确,我在本地计算机上的IP地址以192.168。开头...依此类推,但它给我的IP就像165.123。 ...并且当我使用不同的浏览器打开页面时,会产生不同的结果。

1 个答案:

答案 0 :(得分:1)

本地计算机上的IP是路由器分配的专用IP。远程服务器获取路由器WAN接口的公共IP。如果IP正在更改,则每次连接时,您的ISP必须动态分配IP。

另一种可能性是您的ISP通过代理服务器中继您的网络流量。那么$_SERVER['REMOTE_ADDR']是代理的IP。如果IP每次都更改,则它们可以负载均衡多个代理。