Beside using CAPTCHA there is alternative methods to protect your website control panel .
This is a simple tutorial i made with sessions in PHP to prevent brute force attacks against your website by limiting login attempts for users .
Here is my steps in order to protect your PHP file :
Step A
initiate a session by placing "session_start();" at beginning of your page .
Step B
Here we will use the a session varialbe called "protect" to store our check value for loging attempts, at the first time user brows our page we will give it "0" value, then for each user login retries we will increase its value and when its value reached our attempts limits we stop and kill the page code, there will be 2 part of this code :
First we check if the session protect have no value (means the user brows the page for the first time) we assing "0" as its value .
if(!$_SESSION['protect']) { $_SESSION['protect']=0; }
Second we check if the session protect value is over 2 (3 login attempts) we kill the page code by using die() function.
Step C
step D
Demo :