jdock1 Posted July 23, 2010 Share Posted July 23, 2010 For one of my javascript/php scripts , I have a demo up & I do not want people taking advantage of the demo and using it all the time. How could I make it so the user can only access the page 3 times in a 24 hour period?? I couldnt think of anything Quote Link to comment https://forums.phpfreaks.com/topic/208714-how-would-i-make-it-so-a-user-can-only-access-a-certain-page-3-times/ Share on other sites More sharing options...
jdock1 Posted July 23, 2010 Author Share Posted July 23, 2010 Can anyone help? Or atleast get me started up atleast tell me how I could do this? What functions etc..?? I really need to do this Quote Link to comment https://forums.phpfreaks.com/topic/208714-how-would-i-make-it-so-a-user-can-only-access-a-certain-page-3-times/#findComment-1090440 Share on other sites More sharing options...
.josh Posted July 23, 2010 Share Posted July 23, 2010 without forcing the user to register there is little you can do to prevent it. You can: - set a cookie and look for it, hope the user doesn't delete it - grab and store IP address and compare it with request, hope the user doesn't go through a proxy or there aren't multiple users on the same network with a login system: - real easy to enforce it on the account, but you are basically back to the above as far as users signing up with multiple accounts Quote Link to comment https://forums.phpfreaks.com/topic/208714-how-would-i-make-it-so-a-user-can-only-access-a-certain-page-3-times/#findComment-1090441 Share on other sites More sharing options...
Dragosvr92 Posted July 23, 2010 Share Posted July 23, 2010 yaay im finally back home ! lol You Could create a cookie that lets him access the page only 3 times in 24 hours but sadly idk how to help you with a script or to dont allow access a specified IP To load the page only 3 times again idk how to do it Quote Link to comment https://forums.phpfreaks.com/topic/208714-how-would-i-make-it-so-a-user-can-only-access-a-certain-page-3-times/#findComment-1090443 Share on other sites More sharing options...
.josh Posted July 23, 2010 Share Posted July 23, 2010 The script for those are fairly easy to write, especially the cookie one, the problem I was pointing out though is that they aren't very reliable. Quote Link to comment https://forums.phpfreaks.com/topic/208714-how-would-i-make-it-so-a-user-can-only-access-a-certain-page-3-times/#findComment-1090447 Share on other sites More sharing options...
jdock1 Posted July 25, 2010 Author Share Posted July 25, 2010 without forcing the user to register there is little you can do to prevent it. You can: - set a cookie and look for it, hope the user doesn't delete it - grab and store IP address and compare it with request, hope the user doesn't go through a proxy or there aren't multiple users on the same network with a login system: - real easy to enforce it on the account, but you are basically back to the above as far as users signing up with multiple accounts Thanks bud, I just didnt really know how to implement that... I cant believe I didnt think of that earlier. I got it working by storing the IP address in a database and matching it Quote Link to comment https://forums.phpfreaks.com/topic/208714-how-would-i-make-it-so-a-user-can-only-access-a-certain-page-3-times/#findComment-1090816 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.