Php...... Registration Audit

Source: Internet
Author: User

We can not log in directly after registration, only after the administrator audit to be able to log in, of course, the administrator can also revoke the audit. The audit is used in the Office system more.

Registration page:

<H1>Registered</H1><formAction= "zcchuli.php"Method= "POST"><Div>User name:<inputtype= "text"name= "UID" /></Div><BR/><Div>Password:&nbsp; <inputtype= "Password"name= "pwd" /></Div><BR/><Div>Name:&nbsp; <inputtype= "text"name= "Name" /></Div><BR/><Div>Gender:&nbsp; <inputtype= "text"name= "Sex" /></Div><BR/><Div>Birthday:&nbsp; <inputtype= "text"name= "Birthday" /></Div><BR/><Div><inputtype= "Submit"value= "Register" /></form>
View Code

Registration Processing page:

<?PHP$uid=$_post["UID"];$pwd=$_post["PWD"];$name=$_post["Name"];$sex=$_post["Sex"];$birthday=$_post["Birthday"];//dealing with gender$sex=$sex= = "Male"?true:false;//processing time, formatting the time$time=Date("Y-m-d h:i:s");include(".. /db.class.php ");$db=NewDB ();$sql= "INSERT into Users values (' {$uid}‘,‘{$pwd}‘,‘{$name}‘,{$sex},‘{$birthday}‘,‘{$time} ', False) ';Echo $sql;if($db->query ($sql, 1)){    Header("location:zhuce.php"); }Else{    Echo"Registration failed!" "; }
View Code

Login page:

<H1>Login</H1><formAction= "loginchuli.php"Method= "POST"><Div>User name:<inputtype= "text"name= "UID" /></Div><BR/><Div>Password:&nbsp; <inputtype= "Password"name= "pwd" /></Div><BR/><Div><inputtype= "Submit"value= "Login" /></Div></form>
View Code

Login Processing page:

<?PHPSession_Start();$uid=$_post["UID"];$pwd=$_post["PWD"];include(".. /db.class.php ");$db=NewDB ();$sql= "SELECT count (*) from the Users where Uid = ' {$uid} ' and Pwd = ' {$pwd} ' and IsOk = True ';//user name, password, and audit status are all right to log on$r=$db->strquery ($sql);if($r==1){    $_session["UID"] =$uid;//save user name to session    Header("location:main.php"); }Else{        Header("location:login.php"); }
View Code

Main Page (Audit page):

<?PHPSession_Start();if(Empty($_session["UID"])){    Header("location:login.php"); }$uid=$_session["UID"];?>PHPinclude(".. /db.class.php ");$db=NewDB ();$sql= "SELECT * from the users ORDER by time Desc";//Sort by the registration time in descending order, so the new registration will be on the top$attr=$db->query ($sql);foreach($attr  as $v){    //Processing Status    $zt= ""; if($v[6])    {        $zt= "<span style= ' Background-color:green; Color:white ' > Passed </span> <a href= ' chexiao.php?uid={$v[0]} ' > Undo </a> "; }    Else    {        $zt= "<a href= ' shenhe.php?uid={$v[0]} ' > Audit </a> ";//Get pass Value    }        Echo"<tr><td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$v[4]}</td> <td>{$v[5]}</td> <td>{$zt}</td></tr> "; }?></table>
View Code

Audit Processing page:

<?PHP$uid=$_get["UID"];include(".. /db.class.php ");$db=NewDB ();$sql= "Update users set IsOk = TRUE where uid= ' {$uid}‘";if($db->query ($sql, 1)){    Header("location:main.php");}Else{    Echo"Audit Failed!" "; }
View Code

Undo page:

<?PHP$uid=$_get["UID"];include(".. /db.class.php ");$db=NewDB ();$sql= "Update users set IsOk = False where uid= ' {$uid}‘";if($db->query ($sql, 1)){    Header("location:main.php");}Else{    Echo"Undo Failed!" "; }
View Code

Php...... Registration Audit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.