Home  >  Article  >  Backend Development  >  PHP网站怎么才能限制IP

PHP网站怎么才能限制IP

WBOY
WBOYOriginal
2016-06-13 13:33:56787browse

PHP网站如何才能限制IP?
因为一些原因需要限制网站只让北京的用户能访问,该如何配置呢?难道是去别的地方下IP库,然后每次访问查询一次数据库,如果不是北京的就跳到首页嘛?这个貌似成本有点高哦。。

谢谢~

------解决方案--------------------
没办法,只能这样,也只能根据ip来判断,而且还有被冒充的可能
------解决方案--------------------
只能这样干,还有误伤的可能,人家用代理,你也没办法,使用手机验证自己看下行的通不?
------解决方案--------------------
ip地址好像是有规律的。。每个地方的不一样。具体去网上查查ip的分配规律。如果能找出规律也就不用数据库了。直接判断看匹不匹配。
------解决方案--------------------
这是为什么呢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn