PHP Data Access-registration audit (FOCUS)

Source: Internet
Author: User

About the audit, such as the publication of the review, staff leave the review, drug application audit and so on, the code is similar.

I. Registration function (zhece.php chuli.php)

1.zhece.php

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title></title>67<form method= "POST" action= "chuli.php" >8<div style= "margin:10px 500px" >9

Ten<div> Username: <input type= "text" name= "users"/></div><br/> One<div> Password: <input type= "text" name= "pwd"/></div><br/> A<div> Name: <input type= "text" name= "name"/></div><br/> -<div> Sex: <input type= "text" name= "Sex"/></div><br/> -<div> Birthdays: <input type= "text" name= "Birthday"/></div><br/> the<input type= "Submit" value= "register"/> -<a href= "denglu.php" > Existing account, login now </a> -</div> -</form> +<body> -</body> +

2.chuli.php

1<?PHP2 3 $users=$_post["Users"];4 $pwd=$_post["PWD"];5 $name=$_post["Name"];6 $sex=$_post["Sex"];7 $birthday=$_post["Birthday"];8 require"DBDA.class.php";9 $db=NewDbda ();Ten $sql= "INSERT into users values (' {$users}‘,‘{$pwd}‘,‘{$name}‘,{$sex},‘{$birthday} ', 0) '; One if($db->query ($sql, 0)){ A Header("location:zhuce.php");  -      - } the?>

Two. login function (denglu.php login.php)

1.denglu.php

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title></title>67<body>8<form method= "POST" action= "login.php" >9<div style= "margin:100px 500px" >Ten

One<div> Username: <input type= "text" name= "users"/></div><br/> A<div> Password: <input type= "text" name= "pwd"/></div><br/> -<input type= "Submit" value= "Login"/> -<a href= "zhuce.php" > No account, register now </a> the</div> -</form> -</body> -

2.login.php

1<?PHP2 3 $users=$_post["Users"];4 $pwd=$_post["PWD"];5 require"DBDA.class1.php";6 $db=NewDbda ();7 $sql= "SELECT * from users where users = ' {$users}‘";8 $arr=$db->query ($sql);9 Ten //$arr [0][1] Password One //$arr [0][5] Audit status A  -  - if($arr[0] [1] = =$pwd&&!Empty($pwd)) the { -     if($arr[0] [5]) -     { -         Echo"Login Successful!" "; +     } -     Else{ +         Echo"The audit did not pass!" "; A     } at } - Else{ -     Echo"The user name or password is wrong!" "; - } -  -?>

Three. Administrator's auditing function (guanliyuan.php tongguo.php chexiao.php)

1.guanliyuan.php

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title></title>67 8<body>9Ten<table width= "100%" border= "1" cellpadding= "0" cellspacing= "0" > One<tr> A<td> User name </td> -<td> Password </td> -<td> name </td> the<td> Sex </td> -<td> Birthdays </td> -<td> Operations </td> -</tr> +<?PHP -     require"DBDA.class1.php"; +     $db=NewDbda (); A      at     $sql= "SELECT * from Users"; -     $arr=$db->query ($sql); -      -     foreach($arr  as $v) -     { -         $str= ""; in         if($v[5]) -         { to             $str= "<span style= ' Color:green ' > has passed </span> +<a href= ' chexiao.php?uid={$v[0]} ' > Undo </a> "; -         } the         Else *         { $             $str= "<a href= ' tongguo.php?uid={$v[0]} ' > Through </a> ";Panax Notoginseng         } -          the         Echo"<tr> +<td>{$v[0]}</td> A<td>{$v[1]}</td> the<td>{$v[2]}</td> +<td>{$v[3]}</td> -<td>{$v[4]}</td> $<td>{$str}</td> $</tr> "; -     } -?> the</table> -</body>Wuyi

2.tongguo.php

1<?PHP2 $uid=$_get["UID"];3 require"DBDA.class.php";4 $db=NewDbda ();5 $sql= "Update users set isok=1 where uid= ' {$uid}‘";6 $db->query ($sql, 0);7 Header("location:guanliyuan.php");

3.chexiao.php

1<?PHP2 $uid=$_get["UID"];3 require"DBDA.class.php";4 $db=NewDbda ();5 $sql= "Update users set isok=0 where uid= ' {$uid}‘";6 $db->query ($sql, 0);7 Header("location:guanliyuan.php");

PHP Data Access-registration audit (FOCUS)

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.