简体   繁体   English

如何获得永久IP

[英]How can i get the permanent IP

I want to get the Client Ip with PHP.I allready known that i can get the Ip with $_SERVER['REMOTE_ADDR'];.我想用 PHP 获取客户端 Ip。我已经知道我可以用 $_SERVER['REMOTE_ADDR']; 获取 Ip。 But when i post this value in an Database or remember this IP, next day the client adresse is something else and not the same which yesterday.但是当我在数据库中发布这个值或记住这个 IP 时,第二天客户端地址是别的东西,与昨天不同。

I allready tried to work with $_SERVER['REMOTE_ADDR'];我已经尝试使用 $_SERVER['REMOTE_ADDR']; but the Ip change every day但是Ip每天都在变化

Yes, IPs change.是的,IP 变了。 That's the nature of most residential internet connections.这是大多数住宅互联网连接的性质。 Only a comparatively small number of connections have static IPs.只有相对较少的连接具有静态 IP。 IP addresses are an implementation detail of a data routing mechanism, they're not permanent or unique identifiers. IP 地址是数据路由机制的实现细节,它们不是永久或唯一标识符。

The person controlling the HTTP client would need to run it through an Internet connection with a static IP address.控制 HTTP 客户端的人需要使用静态 IP 地址通过 Internet 连接运行它。 To get one they would need to either use an Internet Service Provider that provides static IP addresses by default or one which provides them as an optional extra (and then take that option).要获得一个,他们需要要么使用默认提供静态 IP 地址的 Internet 服务提供商,要么使用将它们作为可选的额外地址提供的服务提供商(然后选择该选项)。

Then they would have to ensure they didn't use a different Internet connection to make a request in the future (eg by using their laptop in a coffee shop instead of at home, or connecting from their phone while connected via cellular broadband).然后,他们必须确保将来不会使用不同的 Internet 连接来提出请求(例如,在咖啡店而不是在家中使用笔记本电脑,或者在通过蜂窝宽带连接时使用手机进行连接)。


They could also use a proxy server that was connected using a static ip.他们还可以使用使用静态 IP 连接的代理服务器。 The requests would be relayed via the proxy and that its IP address would be used to connect to the server running the PHP.请求将通过代理中继,其 IP 地址将用于连接到运行 PHP 的服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM