PHP Classes

PHP Flood Protection: Prevent abusive accesses from the same IP address

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 174 All time: 8,789 This week: 47Up
Version License PHP version Categories
php-floodprotection 1.0.0MIT/X Consortium ...5.3Networking, PHP 5, Security
Description 

Author

This class can be used to prevent abusive accesses from the same IP address.

It can keep track of the accesses to a certain resource controlled by the current PHP Web script to limit the number of access attempts to a given reasonable number.

The class records in a file of the last accesses for a given period of time to assure that the number of accesses does not exceed the specified limit.

Picture of Melanie Wehowski
  Performance   Level  
Name: Melanie Wehowski <contact>
Classes: 30 packages by
Country: Germany Germany
Innovation award
Innovation award
Nominee: 12x

Documentation

php-floodprotection

Simple IP Flood Protection

Code from https://stackoverflow.com/questions/3026640/quick-and-easy-flood-protection as Class.

use frdl\security\floodprotection\FloodProtection;

 $FloodProtection = new FloodProtection('login', 10, 30);	
 if($FloodProtection->check($_SERVER['REMOTE_ADDR'])){
    header("HTTP/1.1 429 Too Many Requests");
    exit("Hit some *");
 }

  Files folder image Files (3)  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (3)  /  src  
File Role Description
Files folder imagephp-floodprotection (1 directory)

  Files folder image Files (3)  /  src  /  php-floodprotection  
File Role Description
Files folder imagefrdl (1 directory)

  Files folder image Files (3)  /  src  /  php-floodprotection  /  frdl  
File Role Description
Files folder imagesecurity (1 directory)

  Files folder image Files (3)  /  src  /  php-floodprotection  /  frdl  /  security  
File Role Description
Files folder imagefloodprotection (1 file)

  Files folder image Files (3)  /  src  /  php-floodprotection  /  frdl  /  security  /  floodprotection  
File Role Description
  Plain text file FloodProtection.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:174
This week:0
All time:8,789
This week:47Up