Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Web Hosting Services

Notices

Reply
 
Thread Tools
  #1  
Old 08-28-2006, 05:25 AM
maddog's Avatar
maddog maddog is offline
Hatchling Croc
 
Join Date: Nov 2004
Location: Beverly, MA
Posts: 31
Default Download control script?

I need some kind of script that will allow members to download a maximum (ie '10') files (out of thousands) in a 24 hour period and then reset itself after the time period has elapsed.
I suppose a cookie would be used to track each members daily downloads.
Looked hard for this but to no avail.
Any suggestions/info would be appreciated.
Thank you!
__________________
Reply With Quote
  #2  
Old 08-29-2006, 05:30 AM
osirion's Avatar
osirion osirion is offline
Swamp Croc
 
Join Date: Dec 2004
Location: South Africa
Posts: 224
Arrow Re: Download control script?

It's not that hard a script to make; have you tried those script collection sites? (sorry don't know of any, I always make my own!)

Basically you would have a database of files. Each time a file gets downloaded - you would record the time and the IP of the person. Once a certain IP has got a record count of 10 (eg) within a 24 hour time period; you wouldn't let him download any more.

I wouldn't trust a cookie (thats client side); rather record the 'hits' on the server side. PHP/MySQL for the win - I would say. You could also, for optimisation, then purge records older than say 48hrs or so.
Reply With Quote
  #3  
Old 08-29-2006, 09:24 AM
maddog's Avatar
maddog maddog is offline
Hatchling Croc
 
Join Date: Nov 2004
Location: Beverly, MA
Posts: 31
Default Re: Download control script?

Quote:
Originally Posted by osirion
It's not that hard a script to make; have you tried those script collection sites? (sorry don't know of any, I always make my own!)

Basically you would have a database of files. Each time a file gets downloaded - you would record the time and the IP of the person. Once a certain IP has got a record count of 10 (eg) within a 24 hour time period; you wouldn't let him download any more.

I wouldn't trust a cookie (thats client side); rather record the 'hits' on the server side. PHP/MySQL for the win - I would say. You could also, for optimisation, then purge records older than say 48hrs or so.
I have spent the last two days looking for a pre-made script but no luck yet. I guess that learning PHP is going to be a good thing!

One thing I didn't explain well ... I would want the script to allow the count of 10 downloads in a 24 hour period and not allow any more for this periode. At the end of this period the count should recycle back to zero and it would start all over again. If someone wants all 10 files to be the same or each one different that would be okay too. So the individual file names don't need to be tracked only the total count for the time period.

Back to my search ... Thanks for the response!
__________________
Reply With Quote
  #4  
Old 08-29-2006, 10:57 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: Download control script?

I'd agree with mysql/php. Use a login system, and everytime that user clicks a link to a file their count increases by one.
Reply With Quote
  #5  
Old 08-30-2006, 04:11 AM
osirion's Avatar
osirion osirion is offline
Swamp Croc
 
Join Date: Dec 2004
Location: South Africa
Posts: 224
Lightbulb Re: Download control script?

That's right; I would also suggest going the whole "account route". Reason is recording IP's and "blocking" them after 10 downloads doesn't work so well when it comes to people who have dynamic IP's.
EG: User downloads 10 files; then he disconnects/reconnects to get assigned a new IP; User downloads a further 10 files... etc etc

If you do it on an account basis (thats not to say you have to charge for accounts) - then you can lockout the account instead of an IP.

There are of course way's around that (like to keep on creating new accounts); but you just need to find your own way around that.
EG: 1 account per e-Mail address/ID number or something

With the method I mentioned earlier, I didn't mean for it to be 'file specific' - all you need to record is a timestamp and a refernce to the user (ip/account).
Reply With Quote
  #6  
Old 08-30-2006, 01:31 PM
maddog's Avatar
maddog maddog is offline
Hatchling Croc
 
Join Date: Nov 2004
Location: Beverly, MA
Posts: 31
Default Re: Download control script?

Quote:
Originally Posted by slapshotw
I'd agree with mysql/php. Use a login system, and everytime that user clicks a link to a file their count increases by one.
This sounds like a good solution. One concern is having to 'Log in' each time. I know that most people hate to do that!

There are allot of things to digest with this. Just have to keep up chatting about it.

If needed, there must be someone out there whom I can hire to write this script for me but I do not know who!

Thank you!
__________________
Reply With Quote
  #7  
Old 08-30-2006, 04:24 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: Download control script?

I'm not sure if this is against the rules on the board, but you're welcome to contact me-- you should be able to do it through my profile page or by sending a private message.

-Matt

Last edited by slapshotw; 08-30-2006 at 04:26 PM. Reason: forgot about the PM system
Reply With Quote
  #8  
Old 08-30-2006, 06:58 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: Download control script?

Quote:
Originally Posted by slapshotw
I'm not sure if this is against the rules on the board, but you're welcome to contact me.
There aren't any contact restrictions on this board, feel free to contact people or have people contact you. If you wish, you can send me money for no reason, I'm always open for that!
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #9  
Old 08-30-2006, 07:56 PM
maddog's Avatar
maddog maddog is offline
Hatchling Croc
 
Join Date: Nov 2004
Location: Beverly, MA
Posts: 31
Default Re: Download control script?

Quote:
Originally Posted by Serra
There aren't any contact restrictions on this board, feel free to contact people or have people contact you. If you wish, you can send me money for no reason, I'm always open for that!
I like your attitude!
Send to maddog@ ... lol
__________________
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 02:23 AM.