Advertisement
atmoner

Script anti flood php

Sep 13th, 2011
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. //
  3. // Description : Script anti flood
  4. // Version      : 0.0.1
  5. // Auteur       : Atmoner <http://atmoner.com/>
  6. // Url          : http://atmoner.com/script-anti-flood-php/
  7. //
  8. if (!isset($_SESSION)) {
  9.     session_start();
  10. }
  11. // anti flood protection
  12. if($_SESSION['last_session_request'] > time() - 2){
  13.     // users will be redirected to this page if it makes requests faster than 2 seconds
  14.     header("location: /flood.html");
  15.     exit;
  16. }
  17. $_SESSION['last_session_request'] = time();
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement