README.md and License

This commit is contained in:
Divlo
2019-11-08 21:17:50 +01:00
parent 12ac52320f
commit 0192cfd112
3 changed files with 49 additions and 12 deletions

View File

@ -2,13 +2,13 @@
// Rate limit of 1 request per 2 second
session_start();
if (isset($_SESSION['LAST_CALL'])) {
$last = strtotime($_SESSION['LAST_CALL']);
$curr = strtotime(date("Y-m-d h:i:s"));
$sec = abs($last - $curr);
if ($sec <= 2) {
$data = 'Rate Limit Exceeded';
echo $data;
}
$last = strtotime($_SESSION['LAST_CALL']);
$curr = strtotime(date("Y-m-d h:i:s"));
$sec = abs($last - $curr);
if ($sec <= 2) {
$data = 'Rate Limit Exceeded';
echo $data;
}
}
$_SESSION['LAST_CALL'] = date("Y-m-d h:i:s");