<form action= "zhucechili.php" method= "POST" >
<div> Username: <input type= "text" name= "UID"/></div>
<div> Password: <input type= "text" name= "pwd"/></div>
<div> Name: <input type= "text" name= "name"/></div>
<div> Sex: <input type= "text" name= "Sex"/></div>
<div> Birthdays: <input type= "text" name= "Birthday"/></div>
<input type= "Submit" value= "register"/>
</form>
Registration Processing Page
<?php
$uid = $_post["UID"];
$pwd = $_post["pwd"];
$name = $_post["name"];
$sex = $_post["Sex"];
$birthday = $_post["Birthday"];
Include (".. /fengzhuang/dbda.class.php ");
$db = new Dbda ();
$sql = "INSERT into users values (' {$uid} ', ' {$pwd} ', ' {$name} ', {$sex}, ' {$birthday} ', 0, ')";
$db->query ($sql, 0);
Header ("location:login.php");
Login interface
<form action= "loginchuli.php" method= "POST" >
<div> Username: <input type= "text" name= "UID"/></div>
<div> Password: <input type= "password" name= "pwd"/></div>
<input type= "Submit" value= "Login"/>
</form>
Effect:
Login Processing Interface
<?php
$uid = $_post["UID"];
$pwd = $_post["pwd"];
Include (".. /fengzhuang/dbda.class.php ");
$db = new Dbda ();
$sql = "Select pwd from users where uid= ' {$uid} '";
$attr = $db->query ($sql);
if (!empty ($pwd) &&!empty ($attr) && $attr [0][0] = = $pwd)
{
Correct password, Judge status
$szt = "Select isOK from Users where uid= ' {$uid} '";
$AZT = $db->query ($szt);
if ($AZT [0][0])
{
echo "can log in";
}
Else
{
echo "not approved!";
}
}
Else
{
Password error
echo "Wrong password";
}
Review page
<table width= "100%" border= "1" cellpadding= "0" cellspacing= "0" >
<tr>
<th> User name </th>
<th> Password </th>
<th> name </th>
<th> Sex </th>
<th> Birthdays </th>
<th> Status </th>
</tr>
<?php
Include (".. /fengzhuang/dbda.class.php ");
$db = new Dbda ();
$sql = "SELECT * from users";
$attr = $db->query ($sql);
foreach ($attr as $v)
{
$ZT = $v [5];
$str = "";
if ($ZT)
{
$str = "<span style= ' Color:green ' > has passed </span><a href= ' bohui.php?uid={$v [0]} ' > Dismiss </a>";
}
Else
{
$str = "<a href= ' tongguo.php?uid={$v [0]} ' > through </a>";
}
echo "<tr>
<td>{$v [0]}</td>
<td>{$v [1]}</td>
<td>{$v [2]}</td>
<td>{$v [3]}</td>
<td>{$v [4]}</td>
<td>{$str}</td>
</tr> ";
}
?>
</table>
By processing the page
<?php
$uid = $_get["UID"];
Include (".. /fengzhuang/dbda.class.php ");
$db = new Dbda ();
$sql = "Update users set isok=1 where uid= ' {$uid} '";
$db->query ($sql, 0);
Header ("location:shenhe.php");
Dismiss page
<?php
$uid = $_get["UID"];
Include (".. /fengzhuang/dbda.class.php ");
$db = new Dbda ();
$sql = "Update users set isok=0 where uid= ' {$uid} '";
$db->query ($sql, 0);
Header ("location:shenhe.php");
12-29 Registration Review