Prodigal Son Posted July 29, 2008 Share Posted July 29, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/117175-is-this-a-good-way-to-limit-posts-per-minute/ Share on other sites More sharing options...
DeanWhitehouse Posted July 29, 2008 Share Posted July 29, 2008 use date() to get the time Quote Link to comment https://forums.phpfreaks.com/topic/117175-is-this-a-good-way-to-limit-posts-per-minute/#findComment-602701 Share on other sites More sharing options...
Prodigal Son Posted July 29, 2008 Author Share Posted July 29, 2008 use date() to get the time Yea if they can change the computer date/time wouldn't that also bypass it if you have date? Don't have a webserver to test. I thought it only does this because I'm on my localhost. Quote Link to comment https://forums.phpfreaks.com/topic/117175-is-this-a-good-way-to-limit-posts-per-minute/#findComment-602748 Share on other sites More sharing options...
DarkWater Posted July 29, 2008 Share Posted July 29, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/117175-is-this-a-good-way-to-limit-posts-per-minute/#findComment-602752 Share on other sites More sharing options...
Prodigal Son Posted July 29, 2008 Author Share Posted July 29, 2008 I see, good to know. But as far as limiting posts for unregistered users this is the best you can do right? Checking IP's is the only thing I can think of or is there another method I could use? Quote Link to comment https://forums.phpfreaks.com/topic/117175-is-this-a-good-way-to-limit-posts-per-minute/#findComment-602823 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.