error_reporting("E_ALL^E_NOTICE^E_WARNING");
include("conn.php");
?>
管理员登录页面
用户名: 密码: 用户类型:管理员
学生
echo "
转入学生登录界面 ";?>
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 "";
}
}
?>