Jump to content

Help with user bandwidth reset


steviez

Recommended Posts

Hi,

 

I am making a new file hosting script for my site and need to reset my users bandwidth every 15-30 days. I store the last reset time in the database using php time() but im not sure how to make the code work to reset at the time i say.

 

Any help would be great.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/124069-help-with-user-bandwidth-reset/
Share on other sites

Hi,

 

I am making a new file hosting script for my site and need to reset my users bandwidth every 15-30 days. I store the last reset time in the database using php time() but im not sure how to make the code work to reset at the time i say.

 

Any help would be great.

 

Thanks

 

 

As i say here i want to reset the bandwidth of each user after 30 days and everything else stays as is.

Would this do it?

 

<?php
$member = sql_row("SELECT * FROM members");
$resetTime = strtotime('-30 days');
$nowtime = time();
$lastReset = $member['bandwidth_last_reset'];

if (($nowtime - $lastReset) > $resetTime) 
{
echo $member['username'];
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.