<?php session_start(); if (!isset($_SESSION["tid"])) { include './php/fun.inc.php'; urlChange("./login/login.php"); die; } $_SESSION["uid"] = $_GET['uid']; ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>学生管理页</title> <link rel="stylesheet" href="./css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="./css/mystyle.css"> <body> <!-- 顶部导航栏 --> <nav class="navbar navbar-default navbar-inverse navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span>
<?php include_once 'fun.inc.php'; linkDB(); if (!empty($_POST["username"]) && !empty($_POST["passwd"])) { $username = check_input($_POST["username"]); $passwd = check_input($_POST["passwd"]); } else { echo "ERROR(1)!!"; die; } $sql = "SELECT * FROM stu_login WHERE uid = " . $username . " AND passwd = " . $passwd; $res = mysql_query($sql); if (mysql_num_rows($res)) { $uid = @mysql_fetch_assoc($res)["id"]; session_start(); $_SESSION["uid"] = $uid; urlChange("../stu_index.php"); } else { $sql2 = "SELECT * FROM teacher_login WHERE uid = " . $username . " AND passwd = " . $passwd; $res2 = mysql_query($sql2); if (mysql_num_rows($res2)) { $tid = @mysql_fetch_assoc($res2)["id"]; session_start(); $_SESSION["tid"] = $tid; urlChange("../teach_manage.php"); } }