<?php
//login.php
session_start();
session_register("longined");
if($username=="admin" and $passwd=="pass")
{
$longined = true;
header("Location: admin.php");
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head><body>
<form name="form1" method="post" action="">
user:
<input name="username" type="text">
<br>
password
<input name="passwd" type="text">
</form>
</body>
</html>-----------------
<?php
//admin.php
session_start();
session_register("longined");
if($longined!=true)
{
header("Location: login.php");
exit;
}
<html>
........
</html>
//login.php
session_start();
session_register("longined");
if($username=="admin" and $passwd=="pass")
{
$longined = true;
header("Location: admin.php");
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head><body>
<form name="form1" method="post" action="">
user:
<input name="username" type="text">
<br>
password
<input name="passwd" type="text">
</form>
</body>
</html>-----------------
<?php
//admin.php
session_start();
session_register("longined");
if($longined!=true)
{
header("Location: login.php");
exit;
}
<html>
........
</html>
if(true)
{
print "<meta HTTP-EQUIV=REFRESH CONTENT='3; url=login.php'>";
exit;
}
function PangRight($sessionid,$username="NULL",$pagename="NULL"){
GLOBAL $PHP_SELF;
if(session_id()!=$sessionid){
//WSasLog("anonymous","anonymous","no",$PHP_SELF);
echo '
<SCRIPT LANGUAGE="JavaScript">
<!--
window.top.close();
//-->
</SCRIPT>
';
exit;
}
}