[thelist] MySQL & perl question

Seb Barre sebastien at oven.com
Tue Nov 7 10:40:03 CST 2000


At 05:59 PM 11/7/2000 +0200, you wrote:
>The Bool website ( http://www.bool.co.il ) has quite a few message boards
>running using custom-made perl & MySQL software (A sample message board can
>be found here:
>  http://www.bool.co.il/cgi-bin/bu.cgi?page=forum&forum=22343 )
>
>We would like to implement a feature that will prevent users from "flooding"
>message boards with the same message over a short period of time (a few
>minutes).
>
>However, we are not sure how to do that. Anyone have any ideas? We currently
>have about 200-300 messages posted daily, and the numbers are growing all
>the time.

One option is to impose an artificial limit on postings/minute(s) based on 
the originating IP address.  It adds a bit of overhead when submitting the 
post, but if you're recording the time of the post and the poster's IP (in 
Perl use the %ENV array and check $ENV{REMOTE_ADDR}, this is supplied by 
the web server) in your database, it could be done with one SQL query 
("SELECT postid FROM posts WHERE ip = $ENV{REMOTE_ADDR} AND post_time < 
$time" - or something like that), with the returned rows count compared 
against the max allowed posts per timeframe, and simply not saving the post 
if it exceeds your desired maximum.

Let me know if I'm not explaining myself properly, or email me off-list, 
and I'll be happy to elaborate.


--- -- -
Seb Barre - seb at oven.com
OVEN Digital Toronto
Work: 416-595-9750 x 222
Mobile: 416-254-5078
http://www.oven.com/





More information about the thelist mailing list