Reputation: 82
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?
Upvotes: 0
Views: 1132
Reputation:
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.
Upvotes: 0
Reputation: 163301
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.
Upvotes: 5