CodeIgniter Forums
Flood Control - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Flood Control (/showthread.php?tid=48929)



Flood Control - El Forum - 02-02-2012

[eluser]codejack[/eluser]
Hey, guys.

I've got a simple blog on my site, and I was wondering what the simplest way would be to enforce flood control between comments? I have a simple form at the bottom of each single post page with a textarea and a submit button for users.

Any ideas?


Flood Control - El Forum - 02-02-2012

[eluser]WanWizard[/eluser]
It depends. If your flood limitation is going to be short (in terms of seconds), store the last post timestamp in the session, and compare that with the current time at the next post. If it is within the flood limit, show an error message.

If the limitation is like "max one per hour", you'll have to store it in server based storage, as a logout/login would destroy the session.


Flood Control - El Forum - 02-02-2012

[eluser]Jason Stanley[/eluser]
If your site allows anonymous posting then using session's would only stop human users. Chances are the real spam is coming from bots and its unlikely the bot will be storing cookies.