標籤:from log html include get 註冊 pac add set
1.註冊頁面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標題文檔</title></head><body><h1>註冊頁面</h1><form action="zhucechuli.php" method="post"> <div>使用者名稱:<input type="text" name="uid" /></div> <div>密碼:<input type="text" name="pwd" /></div> <div>姓名:<input type="text" name="name" /></div> <input type="submit" value="註冊" /></form></body></html>
2.註冊處理
<?php$uid = $_POST["uid"];$pwd = $_POST["pwd"];$name = $_POST["name"];include("../toupiao/PPO.class.php");$db = new ppo();$sql = "insert into users values(‘{$uid}‘,‘{$name}‘,‘{$pwd}‘,‘0‘)";$db->Query($sql,0);header("location:login.php");
3.登陸頁面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標題文檔</title></head><body><form action="loginchuli.php" method="post"> <div>使用者名稱:<input type="text" name="uid" /></div> <div>密碼:<input type="password" name="pwd" /></div> <input type="submit" value="登入" /></form></body></html>
4.登陸處理
<?php$uid = $_POST["uid"];$pwd = $_POST["pwd"];include("../toupiao/PPO.class.php");$db = new ppo();$sql = "select pwd from users where uname=‘{$uid}‘";$attr = $db->Query($sql);if(!empty($pwd) && !empty($attr) && $attr[0][0] == $pwd){ //密碼正確,判斷狀態 $szt = "select isok from users where uname=‘{$uid}‘"; $azt = $db->Query($szt); if($azt[0][0]) { echo "可以登入"; } else { echo "未通過審核!"; }}else{ //密碼錯誤 echo "密碼不對";}
5.審核頁面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標題文檔</title></head><body><h1>審核頁面</h1><table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr> <th>使用者名稱</th> <th>密碼</th> <th>姓名</th> <th>狀態</th> </tr> <?php include("../toupiao/PPO.class.php"); $db = new ppo(); $sql = "select * from users"; $attr = $db->Query($sql); foreach($attr as $v) { $zt = $v[3]; $str = ""; if($zt) { $str = "<span style=‘ color:green‘>已通過</span><a href=‘bohui.php?uid={$v[0]}‘>駁回</a>"; } else { $str = "<a href=‘tongguo.php?uid={$v[0]}‘>通過</a>"; } echo "<tr> <td>{$v[0]}</td> <td>{$v[1]}</td> <td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$str}</td> </tr>"; } ?></table></body></html>
6.審核通過
<?php$uid = $_GET["uid"];include("../toupiao/PPO.class.php");$db = new ppo();$sql = "update users set isok=1 where uname=‘{$uid}‘";$db->Query($sql,0);header("location:shenhe.php");
7.駁回許可權
<?php$uid = $_GET["uid"];include("../toupiao/PPO.class.php");$db = new ppo();$sql = "update users set isok=0 where uname=‘{$uid}‘";$db->Query($sql,0);header("location:shenhe.php");
PHP註冊審核做法