使用 PHP 进行 IP 过滤

发布于 2025-01-02 08:17:54 字数 248 浏览 3 评论 0原文

我一直在寻找一种创建 IP 过滤器的方法,以便我可以轻松识别客户,但我看到的许多示例在某种程度上我无法理解。

然后我带着一些问题来到这里 客户进入我的网站,IP x 从 $_SERVER ['REMOTE_ADDR'] 恢复,但我一直在阅读一些有关 CRID 的内容,这是检查此 IP 是否在拒绝列表中的一种方法,因为显然90%的客户访问网站时,重启调制解调器时IP就改变了,我不知道我是不是在胡说八道,但是创建一个IP过滤器是个好主意吗?

I was looking for a way to create an IP filter, so that I could easily identify customers, but many examples I saw, I could not understand in a way.

Then, I come here with some questions
A customer enters my site, IP x recovered from $_SERVER ['REMOTE_ADDR'], but I've been reading some things about CRID, which is one way to check if this IP is on the list denied, because obviously 90% of customers accessing the site, when you restart the modem IP is changed, I do not know if I'm talking nonsense, but a good idea to create an IP filter?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只是偏爱你 2025-01-09 08:17:54

您应该结合多个因素,例如会话、cookie 和 IP 过滤器。

但当然用户仍然可以清除 cookie 和会话。

您可能会尝试获取用户电脑或计算机的 mac-id,但它很复杂,不知道它是否有用,而且用户仍然可以更改 mac-id,但这不是一件容易的事情。

You should combine multiple factors such as sessions, cookies and ip filters.

But of course users still be able to clear cookies and sessions.

You may try to get mac-id of user's pc or computer but it is complicated and dunno it is useful or not and also user still can change mac-id but it's not an easy thing to do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文