When you talk about limiting the number of logins, do you mean to limit the number of logins per day, or do you mean that once a person logs in, he cannot log in again when he is online? If it is restricted, one person can log in 5 times a day. It can be designed like this. Add a field to the user table, login_times tinyint (1). Every time you log in, it will be judged whether the value is greater than or equal to 5. If it is less than 5, the login is successful and the number of times is increased by one. The server uses scheduled tasks. This value will be set every early morning. Data cleared 0
replySorry, what I said was not very clear. What I want to ask is: Suppose a user logs in three times and enters the wrong password each time. Then the user is restricted from trying to log in for 30 minutes. May I ask what method you should use to do it? I don’t have any ideas╮(╯▽╰)╭
replyStill restricted by fields, the user table adds two fields times tinyint(1) waittime int(11) default 0; every time you log in, 1 first determines whether the waittime value is 0 based on the user's login name, which is 0 , you can log in, continue to determine the password, if it is not 0, prompt him to wait ((waittime - time()) / 60) minutes, 2. If the value of waittime is 0, determine whether the login name and password are correct, correct, log in Successful, incorrect, times plus 1, if times = 3, then, waittime = time()+ 30 * 60, after successful login, times=0, waittime=0
When you talk about limiting the number of logins, do you mean to limit the number of logins per day, or do you mean that once a person logs in, he cannot log in again when he is online? If it is restricted, one person can log in 5 times a day. It can be designed like this. Add a field to the user table, login_times tinyint (1). Every time you log in, it will be judged whether the value is greater than or equal to 5. If it is less than 5, the login is successful and the number of times is increased by one. The server uses scheduled tasks. This value will be set every early morning. Data cleared 0