Riotblade Posted May 27, 2006 Share Posted May 27, 2006 I've searched all over google for an idea on how this works.I'm trying to setup a page where people can only download a file every 20 seconds or so. The download is called from a function which checks if they have downloaded anything within the past 20 seconds.My idea is to get their ip address and insert it into a db with the date/time.What's puzzling me is how I can check and update the database every ten seconds. I was thinking of using a cron job but the lowest it can go to is minutes.I want to hear the opinions of skilled programmers on how to do this the most efficient way.Thanks Quote Link to comment https://forums.phpfreaks.com/topic/10560-downloads-limitted-by-time/ Share on other sites More sharing options...
shocker-z Posted May 27, 2006 Share Posted May 27, 2006 Well what i would do is store the file as BLOB in a table therefore no one can hotlink it for a start..You don't need to run anything that auto checks the db every 20secs as all you need to do is have another table which stores the IPaddtess and datatime stamp.Then when a user accesses the website you check the table to see if that userIP has accessed the database in the past 20secs.Your download page will basicaly be a php script which checks the database for when the user last downloaded and if success then it will sent the header and files content to the page therefore popping up a download for the file :)I would give you an example but i wrote it and now can't access it.. think work may have caught up with my last year of breaking the AUP lolRegardsLiam Quote Link to comment https://forums.phpfreaks.com/topic/10560-downloads-limitted-by-time/#findComment-39409 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.