php - How to check if a user has more than 5 failed logins and prevent brute force -
I want to avoid many unsuccessful logins and avoid users to stop attacks. If the number of unsuccessful login is 5 or more then captcha or disable access for 15 minutes.
In the code below, whether or not the user successfully logs in. Some codes are unavailable, I use sessions on the right login.
The number of failed logins can be found in the false_logins column.
Thanks for this. You better login Make history, create a And if that happened - for example , You can insert captcha as Google. $ results check if found in the
$ login and
$ password using a query.
$ result = mysql_query ($ qry); $ Member = mysql_fetch_assoc ($ result); // Check whether the query was successful and if the user is verified or not ($ member ['verified']) {// login successful mysql_query ("Update member set IP = '$ Ip', false_login = '0' Where entry = '$ login' '); header ("location: member-index.php"); exit ();} and {// login fail mysql_query ("updated member SET false_login = false_login + 1 WHERE login =' Header ("location: login-unsuccessful.fpp"); exit ();}} and {die ("question failed");} < P>
ip + date column and see that intervals are more than N failed attempts from the same IP.
Comments
Post a Comment