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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.