$adminname1 = $_POST["adminname"]; $adminpassword1 = $_POST["adminpassword"]; $rs=new COM("adodb.recordset"); $rs->open("select * from [admin]",$conn,1,1); $adminname = $rs->Fields(1)->value; $adminpassword = $rs->Fields(2)->value; $rs->Close(); $rs=null; $conn->Close(); $conn=null; $admincookie = $adminname; if ($adminname==$adminname1 && $adminpassword==$adminpassword1){ setcookie("admincookie", $admincookie, time()+3600); echo "<script>window.location.href='admin.php?do=new';</script>"; }else{echo "<script>alert('用户名或密码错误!');window.history.back(-1);</script>";}