Jump to content

How would I make it so a user can only access a certain page 3 times?


jdock1

Recommended Posts

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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.