PHP custom function receiving code. Copy the code as follows :? Php #************************************** * ***** # function: no page operation, automatic expiration function # Parameter: $ onlinetime the last time the current page was used # parameter
The code is as follows:
#*************************************** ****
# Function: No page operation, automatic expiration function
# Parameter: $ onlinetime the last time the current page was used
# Parameter: $ interval page timeout
# Return: None
#*************************************** ****
Function user_mktime ($ onlinetime, $ interval ){
$ New_time = mktime ();
If ($ new_time-$ onlinetime> $ interval ){
Echo "logon timeout! ";
Session_destroy ();
Exit ();
} Else {
$ _ SESSION [times] = mktime ();
}
}
User_mktime ($ _ SESSION [times], 3600) // The current page is automatically expired when the instance is not used for one hour.
?>
The http://www.bkjia.com/PHPjc/322165.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/322165.htmlTechArticle code is as follows :? Php #************************************** * ***** # function: no page operation, automatic expiration function # Parameter: $ onlinetime the last time the current page was used # parameter...