login.html

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript">
var xmlHttp = false;
function createXMLHttpRequest()
{
    
var http;
    
if(window.ActiveXObject)
    {
        http 
= new ActiveXObject('Microsoft.XMLHTTP');
    }
    
else if(window.XMLHttpRequest)
    {
        http 
= new XMLHttpRequest();
    }
    
return http;
}
function setSessionLifetime(checked) {
    xmlHttp 
= createXMLHttpRequest();
    
var url = 'session_setup.php';
    
if (checked == true) {
        url 
+= '?set=1';
    } 
else {
        url 
+= '?set=0';
    }
    xmlHttp.open(
"GET", url, true);
    xmlHttp.onreadystatechange 
= function() {
        
if(xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            window.location.href
='session_printlifetime.php';
        }
    }
    xmlHttp.send(
null);
}
</script>
</head>

<body>
<?php ?>
<input type="checkbox" name="setlifetime" id="setlifetime" value="1" onclick="setSessionLifetime(this.checked)" />set one life's session lifetime
</body>
</html>

相关文章: