登录审核
1.建立登录页面
<form action="loginchuli.php" method="post"> <div>用户名:<input type="text" name="uid" /></div> <div>密码:<input type="text" name="pwd" /></div> <div><input type="submit" value="登录" /></div> </form>
2.登录处理页面(如果uid、pwd不等于空,并且uid=pwd 则可以登录)
<?php $uid = $_POST["uid"]; $pwd = $_POST["pwd"]; include("../DBDA.class.php"); $db = new DBDA(); $sql = "select pwd from users where uid='{$uid}'"; $mm = $db->StrQuery($sql); if($pwd != "" && $pwd==$mm) { $ssh = "select isok from users where uid='{$uid}'"; $n = $db->StrQuery($ssh); if($n==1) { header("location:main.php"); } else { echo "该账号还未经过审核"; } } else { echo "用户名或密码错误"; }
3.建立主页(1是通过0是未通过。判断$[5]状态栏 ==1)
<h1>注册审核</h1>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>用户名</td>
<td>姓名</td>
<td>状态</td>
</tr>
<?php
include("../DBDA.class.php");
$db = new DBDA();
$sql = "select * from users";
$attr = $db->Query($sql);
foreach($attr as $v)
{
//处理状态
$zt = "";
if($v[5]==1)
{
$zt = "<span style='color:green'>已通过</span>";
}
else
{
$zt = "<a href='shenhe.php?u={$v[0]}'>审核</a>";
}
echo "<tr><td>{$v[0]}</td><td>{$v[2]}</td><td>{$zt}</td></tr>";
}
?>
</table>
4.审核处理页面
<?php include("../DBDA.class.php"); $db = new DBDA(); $uid = $_GET["u"]; $sql = "update users set isok=1 where uid='{$uid}'"; $db->Query($sql,0); header("location:main.php");

浙公网安备 33010602011771号