简体   繁体   中英

php strong ban system based on ip address

I have a social networking website I want build a banning system based on ip address. About how we can control a user with dynamic ip address? If I will block user based on account he/she can create new account. What will be best solution?

You can't, and nor should you.

An IP address does not uniquely identify a user. It could be anywhere from one user to an entire country. If they have a dynamic IP from their ISP, then their IP will change, and the only thing you could do is block the whole ISP... not a good idea.

Even if you could block by IP, it doesn't matter, as someone could use a proxy.

Ban their account instead. Link the account to an e-mail address. Basically, make it more of a hassle to get around being banned instead. That's the best you can do.

If I were you, I'd use something like this:

if (window.localStorage) {
    localStorage['banned'] = '1';
}

Noobs will never know that you're blocking them through HTML 5 Local Storage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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