Jump to content

Is this a good way to limit posts per minute?


Prodigal Son

Recommended Posts

I have a comments section (doesn't require registration). And to limit posts to max 1 per minute, I have the users IP recorded and the time of posting. Each time when they post I match the IP and grab the timestamp of their post and add 60 seconds to it. If it's less than or equal to time() they can post a message, otherwise a warning says they need to wait a certain amount of time before they can post again. Not sure if this is the best way to do it, but that's how I did it. Also I noticed that I can just change my computer time and I can bypass this restriction. My assumption is that I am using my localhost so I can do this. If I'm on a web server a visitor couldn't do that right?

It's because you're on your localhost.  It should work as expected on a working web server.  But I know that AOL users can change IPs (unwillingly, mind you) on every request sometimes.  Which could be a problem.  I remember a post about it a while ago and someone linked to an article on it after someone was skeptic.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.