PHP Classes

PHP Block Login Attempts: Block login attempts from IP after failures

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 316 This week: 1All time: 7,244 This week: 172Up
Version License PHP version Categories
block-login-attempt 1.0Freeware5PHP 5, User Management, Security
Collaborate with this project 


block-login-attempt -


This class can block login attempts from IP after failures.

It can check if a login attempt is valid and if it failed it increases the count of failed attempts and stores it in session variables.

Repeated failed login attempts will make the user IP address be added the blocked IP list.

The access from listed IP addresses will blocked for a given period of time after which the user may try again.

Picture of Bharat Parmar
  Performance   Level  
Name: Bharat Parmar <contact>
Classes: 11 packages by
Country: India India
Age: 32
All time rank: 52230 in India India
Week rank: 198 Up18 in India India Up
Innovation award
Innovation award
Nominee: 3x


$Login = new Login();
<!DOCTYPE html>
        <title>Block Login Attempt : Bharat Parmar</title>

<h4>Example : Block Login Attempt with IP Address </h4>
    <li>Form Submit</li>
    <li>Form Data Clear</li>
    <li>Click on your Web Page</li>
    <li>Copy Web Page Content</li>
    <li>Print Web Page</li>
    <li>Right Click on Web Page</li>
<p>Whenever the above events will be triggered, the screenshot of the webpage will be stored in the Screenshot Directory as well as the event log will be generated in event-log.log file in the same directory. Event Log will store data like Event Name, Screenshot Image File Name, Time and IP Address.</p>
    <?php $Login->DisplayMessage(); ?>
<form method="post">
        <table width="50%">
                <td><input type="text" name="username"></td>
                <td><input type="password" name="password"></td>
                <td colspan="2" align="center">
                    <input type="submit" name="login_submit" value="Login">

  Files folder image Files  
File Role Description
Files folder imageclass (1 file)
Accessible without login Plain text file blocked.html Data Auxiliary data
Accessible without login Plain text file blockedip.json Data Auxiliary data
Accessible without login Plain text file config.php Conf. Configuration script
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  class  
File Role Description
  Plain text file Login.class.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:7,244
This week:172Up