Status
Not open for further replies.

sammaster

Active Member
49
2013
10
0
Hey WJ dudes,

I've been searching to get something like this one:

There are about ten links and about thousand users (Here each user stands for each unique IP address) will click those ten links at different time zones and spans. What I need is that if one user clicked a link, he shouldn't be able to click that link before exact 24 hours of the last click on that particular link. This condition should be with every link and with every user.

I thought of performing this idea in multiple aspects like logging the IP in row of link in database, prompting user if his IP is found there in db table and for reset, making up a cron to clear out the db table every 24 hours. But what the problem will be that the whole table will reset every 24 hours and not dependent upon the clicked time of a user, i.e. the user who clicked the link even few minutes before the reset will again be able to click after few minutes of reset and that will mean just minutes difference between two clicks made by same IP on same link.

If someone got the point, please be generous to share just a basic overview of how can it be done. I don't need the exact codes, just the hints will too be helpful for me.

Best Regards,
Sam.
 
3 comments
Seems the easiest way to do this would be to use a mysql DB that has 2 simple tables.

the first the link table with a primary id and the link.
the second with the ip address, the clicked link primary id and the time clicked.

First set the html to have a hidden field primary id for the link.
Then search for the ip / link primary id in the second table.
Compare current time to time clicked and if it is greater than 24 hours allow them to get the file or whatever.
 
Status
Not open for further replies.
Back
Top