Image

Imagefallenairmen wrote in Imagephp

Listens: Ray Charles & Elton John - Sorry Seems To Be The Hardest Word

Anti-Flood methods

   I've been thinking about an anti-flood mechanism for php that doesn't involve some sort of captcha method.  I looked into using shared memory but its back to the same problem of having a race condition between scripts.  As a temporary work around I guess I could just use a MySQL table, but I was hoping for something with a smaller memory and speed foot print.  Anyone got any idea's?

Example of what I mean:
  
   If 10000 hits are made in less then 30 minutes to a php script, the script has a switch at the beginning that immediately dies(). 

I thought of a cron script that runs every 30 minutes and counts the number of new lines from an offset in the record then adds "deny from $userIP" under the Order deny,allow directive of .htaccess, but was wondering if there is anything else before I start making a bunch of regEx's to parse the access log.