headcutter Posted September 25, 2006 Share Posted September 25, 2006 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 https://forums.phpfreaks.com/topic/21963-set-a-limit-on-number-of-downloaded-mp3/ Share on other sites More sharing options...
HuggieBear Posted September 25, 2006 Share Posted September 25, 2006 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.RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/21963-set-a-limit-on-number-of-downloaded-mp3/#findComment-98079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.