<body background="tu/6.png"><p>? <?PHPerror_reporting("E_ALL^E_NOTICE^E_WARNING");include("conn.php");? ? ?></p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><div? >? <table width="323" height="154" border="0"? align="center" background="tu/2.jpg">??? <form? action=""? method="post" >????? <tr>??????? <h3 align="center"> 管理員登錄頁面</h3>????? </tr>????? <tr>??????? <td> 用戶名: ????????? <input type="text" name="username" /></td>????? </tr>????? <tr>??????? <td>密碼: ??????????? <input type="password" name="password" /></td>????? </tr>?? <tr>??????? <td> 用戶類型:?? <select id="utype">?? <option value="adm">管理員</option>?? <option value="stu">學(xué)生</option>?? </select>???????? </td>????? </tr>????? <td align="center"> ???????? <input type="submit" value="登陸" name="login" />?????? </td>????? <?php?? echo "<tr>?? <td? colspan='3'> <a href='login-student.php'>轉(zhuǎn)入學(xué)生登錄界面</a></td>? </tr>?";?>??? </form>? </table>? ? <?php? if(isset($_POST["login"])){???? setcookie("a",$_POST["username"],time()+3600);? $n=$_POST["username"];? $sql="select * from admin where id='$n'";? $sql="select * from student1 where sno='$n'";? $result=mysql_query($sql,$link);? $query=mysql_fetch_array($result);?? ?? if (($query['id']==$_POST['username'])&& ($query['pass']==$_POST['password'])???? && ($_POST['username']!=null) && ($_POST['password']!=null) &&($_POST['utype']=="adm") ) {?? header("location:admin_index.php"); ???? }if (($query['sno']==$_POST['username'])&& ($query['pass']==$_POST['password'])??? && ($_POST['username']!=null) && ($_POST['password']!=null) &&($_POST['utype']=="stu") )?? {??? header("location:student_index.php");? ?????? ?? ?? }? else{????? echo "<script> alert('用戶名或密碼不正確,請重新輸入!');</script>";??????? }?? }??>
添加回答
舉報
0/150
提交
取消