Jump to content

Only letting a user click a link once every 24 hours?


TJMAudio

Recommended Posts

I think what Jesi's trying to say is, we're not here to do it for you.  If you have attempted some code already then post it here and we can point you in the right direction.

 

OK, so are the people that visit the page registered in some way or are they just random visitors to the site?

 

Regards

Huggie

Link to comment
Share on other sites

If I were you I'd use a cookie. See http://www.websitepublisher.net/article/php_cookies/

 

In the cookie I would store the the time 'right now', and expire the cookie in 24 hours from now. See http://www.plus2net.com/php_tutorial/php_date_time.php

 

On your page check to see if a cookie exists. If it does, send the user away as they are still within the 24 hours limit. If no cookie exists, let them see the page.

Link to comment
Share on other sites

It will work. Most people don't know how to delete or manipluate cookies. If the protected page is very important, then I agree that there are better methods such as using a database to store the timestamp. However, I have set the poster in a direction that he/she will learn something rather than just an unhelpful 'that's up tp you' comment.

Link to comment
Share on other sites

That's up to you. If you start somewhere and run into trouble, we can offer more help.

You'll likely want to store these times in your database.

So I come here for help, and all I get is figure it out yourself?

 

jesi can be like that sometimes. just brush it off. but she IS right... cookies are NOT the way to go with this one. it's gotta be stored in the database.

 

i will help you approach this issue. but first, i'm gonna need a little more info. a user clicks a link, and then what? taken to a page? what page? where? when would the user be at a page where they would see this link again? do you want the link to be there, except not an active link? or do you want nothing to show up?

 

huggie's got a good question, are these registered users? that is an extremely important question that will heavily dictate the method of pursuing this issue

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.