I wrote this
<?php
session_start();
if(!isset($_SESSION['now'])){
$_SESSION['now'] = time();
}
if(time() > ($_SESSION['now'] + 300)){
echo "15 minutes have passed";
} else {
echo "waiting";
}
?>
What I want to do is, let the user wait for 15 minutes before he/she can view the page. Is the code correct?