login页面 <form action="loginchuli.php" method="post"> <div>用户名:<input type="text" /></div> <div>密码:<input type="text" /></div> <input type="submit" value="登录" /> </form> loginchuli页面 <?php session_start(); $uid = $_POST["uid"]; $pwd = $_POST["pwd"]; include("../DBDA.php"); $db = new DBDA(); $sql = "select count(*) from Users where Uid=\'{$uid}\' and Pwd = \'{$pwd}\'"; $z = $db->StrQuery($sql); if($z == 1) { $_SESSION["uid"] = $uid; header("location:main.php"); } else { header("location:login.php"); }
PHP 权限管理
内容版权声明:除非注明,否则皆为本站原创文章。