Hello i'm having trouble with making like a simple waiting time between 2 php requests like... i have this code (for example) :
readfile($link);
the visitor request this php code to download a file ... but within 10 seconds he requests another one ... i want to make a limit for the time like if he requested once he has to waiting from the first download to the allowance to the second request (download) 30 seconds ... any idea of how could this be done ? in php ... thank you in advance :)
edit : i tried with the help of the post below but did not work
if (!isset($_SESSION['last_download'])) $_SESSION['last_download'] = 0; {
if (time() - $_SESSION['last_download'] > 10){
$_SESSION['last_download'] = time();
echo $_SESSION['last_download'];
}else {echo"".time() - $_SESSION['last_download']."";}}
but its not saving the session ... any help ?