Answer the question
In order to leave comments, you need to log in
MySql ban system, will it work?
Hello, I have a code and an idea about creating a ban system in MySql or MySqli.
In other matters, the system works like this:
1. When entering any page, a script is included that checks for the presence of a user's nickname and id in the ban list.
2. If there is one, then the script immediately redirects the person from each page to 1 with a sign in which the reason for the ban and the date of unlocking (if any) is written.
In general, I want to know if such a system will provide at least some kind of protection?
Answer the question
In order to leave comments, you need to log in
table users field ban (boolean) during authorization we get this field if TRUE then we send it. on pages to which users have access, we check that the user is logged in. A banned user does not receive authorization and therefore is on the site as a guest.
Certainly. In places where authorization is needed, provided that the authorization "provides security".
I have some doubts about the cost of this approach. When you go to ANY page, the script will be included. Now imagine that 100,000 users simultaneously opened 10 pages each? ;)
In fact, there is something in your words, and this something is nothing at all if the site is not designed for a large number of visitors. Or just for the first time. In the future, you will still have to refuse this, otherwise you will burn the servers.
PS Still, it's better to have a banned field in the users table than to create a separate table for the sake of it. Good luck :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question