如何使用PHP通过IP地址阻止用户? [英] How do I block a user by IP Address using PHP?

查看:82
本文介绍了如何使用PHP通过IP地址阻止用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做什么通过IP来阻止用户... 示例:如果用户拥有ip 86.46.21.147,那么只有前2个数字块才会阻止用户(86.46) ) 变化!我知道这样做是不安全的,因为我最终会无意中阻止其他人,但这些用户将能够给我发消息并说他们被意外阻止了!​​

解决方案

看看这个:如何阻止多个ip-addresses-using -php [ ^ ]

What I want to do block a user by IP... Example: If a user has the ip 86.46.21.147 then it would block the user only if the first 2 blocks of numbers (86.46) changes! I know it's not safe doing this because I'll end up blocking other people unintentionally but those users will be able to message me and say that they were accidentally blocked!

解决方案

Check this out: how-to-block-multiple-ip-addresses-using-php[^]


这篇关于如何使用PHP通过IP地址阻止用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆