Copy CodeThe code is as follows:
#*******************************************
#作用: Page no action, auto expiration function
#参数: $onlinetime The last time the current page was used
#参数: $interval page Time-out
#返回: None
#*******************************************
function User_mktime ($onlinetime, $interval) {
$new _time = Mktime ();
if ($new _time-$onlinetime > $interval) {
echo "Login timed out!" ";
Session_destroy ();
Exit ();
}else{
$_session[times] = Mktime ();
}
}
User_mktime ($_session[times],3600)//1 hours not used, the current page automatically expires
?>
http://www.bkjia.com/PHPjc/322165.html www.bkjia.com true http://www.bkjia.com/PHPjc/322165.html techarticle Copy the code as follows:? PHP #******************************************* #作用: Page no action, auto-expiration function #参数: $onlinetime The current page last time to use #参 ...