if ($_SERVER['REQUEST_METHOD']=='GET' && $_GET['download']==='1')
{
$handle = fopen('lastdownload.txt','rw');
$date = @fread($handle,filesize('lastdownload.txt'));
if (time() - 30 * 60 > $date)
{
fwrite($handle,time());
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename="dwnld_'.date('d_m_Y_H_i',filemtime('download.zip')).'.zip"');
readfile('download.zip');
}
exit;
}
Hi everyone, i have a problem about limiting download count.
I want to limit my download count.
If someone request the file with ?download=1
It checks the current time and the time inside the file
If 30 minutes passed before the last download, it lets you download again, else it just exits.
Any help please?
Thank you.