Forum Moderators: phranque
Is there anyway of setting links to .zip files on my server to go down after using up 5gb for example?
I ask this because although near the end up the month, I don't want files I've just uploaded and displayed on site to use up the 10gb I have left ... and would like to be able to haveit so that after 5gb of bandwidth is used up, the link won't be displayed.
Apart from writing a php script to count the number of times clicked and then don't show the link once being download X times ( which would use up 10gb ) .. is there an easier way?
Thanks.
<?php // connect to your database first
$query = "select pagecount from countertable";
$result = mysql_query($query)
or die ("This did not work");
if ($pagecount >= '100') // or any number you like
{echo "Sorry, no download today";}
else {echo "The link for the download goes here";}
?>
Then send your downloaders to a page that increments the counter. You'll also need a script to reset the counter, for your admin page.