日期:2014-05-17 浏览次数:20500 次
<?php
include("Sql.php");
if ($_GET[out])
{
setcookie("cookie","out");
echo "<script language=\"javascript\">localhost.href='login.php';</script>";
}
if ($_POST[id]=='xxx')
{
$pw=md5($_POST[pw]);
if($pw=='e1bfd762321e409cee4ac0b6e841963c')
{
setcookie("cookie","ok");
echo "<script language=\"javascript\">localhost.href='login.php';</script>";
}
}
include("Head.php");
if ($_COOKIE['cookie']!='ok'){
?>
<SCRIPT language=javascript>
function Checklogin()
{
if (myform.id.value=="")
{
alert ("请填写登陆名");
myform.id.focus();
return false;
}
if (myform.pw.value=="")
{
alert ("密码不能为空");
myform.pw.focus();
return false;
}
}
</SCRIPT>
<form action="" method="post" name="myform" onsubmit="return Checklogin();">
ID:<input type="text" name="id" ><br>
PW:<input type="password" name="pw"> <input type="submit" name="submit" value="登陆" >
</form>
<?
}else{
?>
<a href='?out=login'>退出</a>
<?
}
?>