<!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>login</title> <mce:style type="text/css"><!-- *{ margin:0; padding:0;} body{ background:#FFCC66; font:12px Arial, Helvetica, sans-serif;} ul{ list-style:none;} #my{ width:500px; margin:20px auto;} #my li{ height:30px;} --></mce:style><style type="text/css" mce_bogus="1"> *{ margin:0; padding:0;} body{ background:#FFCC66; font:12px Arial, Helvetica, sans-serif;} ul{ list-style:none;} #my{ width:500px; margin:20px auto;} #my li{ height:30px;}</style> <mce:script type="text/javascript" language="javascript"><!-- function check(){ if(login.user.value==""){ alert("用户名不能为空"); login.user.focus(); return false; } if(login.pwd.value==""){ alert("密码不能为空"); login.pwd.focus(); return false; } } // --></mce:script> </head> <body> <?php // include 'conn.php'; //include 'menu.html'; if($_GET['out']){ setcookie("cookie","out"); echo "<mce:script language=/"javascript/"><!-- location.href='login.php'; // --></mce:script>"; } if($_POST[user]=='admin'){ $pw=md5($_POST[password]); if($pw=='e1bfd762321e409cee4ac0b6e841963c'){ setcookie("cookie", "ok"); echo "<mce:script language=/"javascript/"><!-- location.href='login.php'; // --></mce:script>"; } }else{ echo "出错了"; } if($_COOKIE['cookie']!='ok'){ ?> <form name="login" action="login.php" method="post" οnsubmit="return check();"> <ul id="my"> <li>用户:<input type="text" name="user" size="10" /></li> <li>密码:<input type="password" name="pwd" size="10" /></li> <li><input type="submit" name="submit" value="登陆" /></li> </ul> </form> <?php }else{ ?> <a href="?out=login" mce_href="?out=login">退出</a> <?php } ?> </body> </html> 没反应,不报错 不知道什么原因