註冊頁面 <body ><h1>註冊頁面</h1><form action="zhucechuli.php" method="post"><div>用戶名:<input type="text" name="uid"/> </div><div>密碼:<input type="text" name="p ...
註冊頁面
<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>
<div>性別:<input type="text" name="sex"> </div>
<div>生日:<input type="text" name="birthday"> </div>
<input type="submit" value="註冊"/>
</form>
</body>
註冊處理頁面
<?php
$uid = $_POST["uid"];
$pwd = $_POST["pwd"];
$name = $_POST["name"];
$sex = $_POST["sex"];
$birthday = $_POST["birthday"];
include ("LZY.class.php");
$db = new LZY();
$sql = "insert into zhuce VALUES ('{$uid}','{$pwd}','{$name}','{$sex}','{$birthday}',0)";
if($db->query($sql,0))
{
header("location:zhuceyemiandenglu.php");
}
else
{
echo "註冊失敗!";
}
登錄頁面
<body>
<h1>頁面登錄</h1>
<form action="zcdlchuli.php" method="post">
<div>用戶名:<input type="text" name="uid"/> </div>
<div>密 碼:<input type="password" name="pwd"/></div>
<div><input type="submit" value="登錄"/> </div>
</form>
</body>
註冊登錄處理頁面
<?php
$uid = $_POST["uid"];
$pwd = $_POST["pwd"];
include ("LZY.class.php");
$db = new LZY();
$sql = "select * from zhuce where uid='{$uid}'";
$arr = $db->Query($sql);
if($arr[0][1] == $pwd && !empty($pwd))
{
if($arr[0][5])
{
header("location:zcmain.php");
}
else
{
echo "該用戶尚未通過審核!";
}
}
else
{
echo "登錄失敗!";
}
註冊主界面
<body>
<h1>用戶審核</h1>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>用戶名</td>
<td>姓名</td>
<td>性別</td>
<td>生日</td>
<td>操作</td>
</tr>
<?php
include("LZY.class.php");
$db = new LZY();
$sql = "select * from zhuce";
$arr = $db->Query($sql);
foreach($arr as $v)
{
$str = $v[5]?"<span style='background-color:green'>已通過</span>":"<a href='zctongguo.php?uid={$v[0]}'>通過</a>";
echo "<tr>
<td>{$v[0]}</td>
<td>{$v[2]}</td>
<td>{$v[3]}</td>
<td>{$v[4]}</td>
<td>{$str}</td>
</tr>";
}
?>
</table>
</body>
</html>
審核通過代碼
<?php
$uid = $_GET["uid"];
include("LZY.class.php");
$db = new LZY();
$sql = "update zhuce set isok=1 where uid='{$uid}'";
if($db->Query($sql,0))
{
header("location:zcmain.php");
}
else
{
echo "通過失敗!";
}