Can anyone help this newbie figure ot whats wrong with the following code:
session_start();
$ran = “”;
$rand = $_SESSION[‘rand’];
if (empty($rand)) {
srand((float)microtime()*1000003);
$rand = rand();
$_SESSION[‘rand’] = $rand;
}
$inactive = 3; //seconds
if (isset($_SESSION[‘timeout’])) {
$session_life = time() - $_SESSION[‘timeout’];
if ($session_life > $inactive) {
session_destroy();
}
}
$_SESSION[‘timeout’] = time();
The error/notice I receive is :
Notice: Undefined index: rand in C:\xampp\htdocs\paginate.php
Thanks