Possible Duplicate:
Prevent PHP script from being flooded
Certain “friends” of mine keep messing around on my site by holding down the refresh key. This makes their content’s pageviews unrealistically increase and also it adds server load to points where PHP stops running.
I was hoping if there was a way to prevent such intense refreshes (one of them got 30 thousand requests in 1 1/2 hrs) using PHP or JavaScript?
You could always count how many requests a user is making from a certain ip address, and stop returning anything but an Unauthorized after a certain limit is reached.
This is a pretty simple solution, but would probably do the job. You can cut it off by requests/time interval or like no more than 100 page requests in two minutes or something. You could then either ban the IP, or return error codes for a specified amount of time. That specified amount of time could be something hard coded like 5 hours, or you could just wait for their requests/time interval to go down organically.
You put that code on every page of your site, and it will ensure that users have not been breaking your predetermined security rules.