Jump to content

set a limit on number of downloaded mp3?


headcutter

Recommended Posts

For bandwidth reasons I want to limit people on my website to download let's say 10,000 mp3's per month since I don't want mp's transfers to consume my bandwidth. I am sure there is a way to do it, but I am quite lost. Are there any scripts which are available for the pubic that would do so? Any help will be appreciated.
Link to comment
Share on other sites

Why not have a counter running, and just use a conditional statement to tell if the mp3's should be displayed or not.

[code=php:0]
$sql = "SELECT max, count FROM downloads";
$query = mysql_query($sql);
$result = mysql_fetch_row($query);
if ($result['count'] >= $result['max']){
  echo "Sorry, reached maximum number of downloads this month\n";
}
else {
  //echo your page contents here
}
[/code]

This is just thrown together, but should gie you an idea.

Regards
Huggie
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.