Once registered, the information will be saved to the session and approved before being added to the database.
The information that is added to the database is logged in after the audit passes after the status becomes passed. If the user's bad behavior is found, it can be revoked.
Registration page:
1<! DOCTYPE html Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >234<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>5<title> Registration </title>67 8<body>9Ten<form action= "zcchuli.php" method= "POST" > One<div> AUser name: <input type= "text" name= "uid"/><br/><br/> -Password: <input type= "text" name= "PSW"/><br/><br/> -Name: <input type= "text" name= "name"/><br/><br/> theGender: <input type= "text" name= "sex"/><br/><br/> -Birthday: <input type= "text" name= "Birthday"/><br/><br/> -<input type= "Submit" value= "register"/> -</div> +</form> - +</body> AView CodeRegistration processing: (to be audited after successful registration)
1<?PHP2 include(".. /dbda.class.php ");3 $db=NewDbda ();4 $uid=$_post["UID"];5 $PSW=$_post["PSW"];6 $name=$_post["Name"];7 $sex=$_post["Sex"];8 9 $s=1;Ten if($sex= = "female") One { A $s=0; - } - the $birthday=$_post["Birthday"]; - - - $sql= "INSERT into Users values (' {$uid}‘,‘{$PSW}‘,‘{$name}‘,{$s},‘{$birthday} ', False) '; + - //echo $sql; + $r=$db->query ($sql, 1); A at if($r) - { - Header("location:zhuce.php"); - } - Else - { in Echo"Registration failed!"; -}
View CodeLogin page:
1<! DOCTYPE html Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >234<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>5<title> Login </title>67 8<body>9Ten<form action= "dlchuli.php" method= "POST" > One<div> AUser name: <input type= "text" name= "uid"/><br/><br/> - -Secret code: <input type= "text" name= "PSW"/><br/><br/> the -<input type= "Submit" value= "Login"/> -</div> -</form> + -</body> +View CodeLogin Processing: (Audit pass to log in)
1<?PHP2 Session_Start();3 include(".. /dbda.class.php ");4 $db=NewDbda ();5 6 $uid=$_post["UID"];7 $PSW=$_post["PSW"];8 9 $sql= "SELECT count (*) from users where Uid= ' {$uid} ' and psw= ' {$PSW} ' and Isok=true ';Ten One $r=$db->strquery ($sql); A - if($r==1) - { the $_session["UID"]=$uid; - Header("location:main.php"); - } - Else + { - Header("location:denglu.php"); +}
View CodeAudit Main Page: (Visible only to administrators)
1<! DOCTYPE html Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >234<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>5<title> Audit </title>67 8<body>9Ten One<table width= "100%" border= "1" cellpadding= "0" cellspacing= "0" > A<tr> -<td> name </td> -<td> Sex </td> the<td> Birthdays </td> -<td> Status </td> -</tr> - +<?PHP - include(".. /dbda.class.php "); + $db=NewDbda (); A $sql= "SELECT * from Users"; at $attr=$db->query ($sql); - foreach($attr as $v) - { - - //State judgment isOK - $zt=""; in if($v[5]) - { to $zt= "<span style= ' Color:green ' > passed </span> <a href= ' chexiao.php?uid={$v[0]} ' > Undo </a> "; + } - Else the { * $zt= "<a href= ' shchuli.php?uid={$v[0]} ' > Audit </a> "; $ }Panax Notoginseng - the Echo"<tr> +<td>{$v[2]}</td> A<td>{$v[3]}</td> the<td>{$v[4]}</td> +<td>{$zt}</td> -</tr> "; $ $ } - -?> the</table> -</body>WuyiView CodeAudit Processing: (Audit success Show passed)
1<?PHP2 $uid=$_get["UID"];3 4 include(".. /dbda.class.php ");5 $db=NewDbda ();6 7 $sql= "Update users set isok=true where uid= ' {$uid}‘";8 9 if($db->query ($sql, 1))Ten { One Header("location:main.php"); A } - Else - { the Echo"Audit Failed!" "; -}
View CodeUndo Processing: (Revocation audit, unable to login)
1<?PHP2 $uid=$_get["UID"];3 include(".. /dbda.class.php ");4 $db=NewDbda ();5 $sql= "Update users set Isok=false where uid= ' {$uid}‘";6 if($db->query ($sql, 1))7 {8 Header("location:main.php");9 }Ten Else One { A Echo"Undo Failed!" "; -}
View Codepage Run display:PHP Registration Review (0523)