php資料訪問-註冊審核(重點)

來源:互聯網
上載者:User

標籤:strong   審核   撤銷   錯誤   htm   meta   .com   span   lsp   

關於審核,如發表文章的審核、員工請假的審核、藥品申請的審核等等,代碼大同小異。

一.註冊功能(zhece.php   chuli.php)

1.zhece.php

 

 1 <!DOCTYPE html> 2 <html> 3     <head> 4         <meta charset="UTF-8"> 5         <title></title> 6     </head> 7     <form method="post" action="chuli.php"> 8     <div style="margin:10px 500px">  9             <h2 > &nbsp;&nbsp; &nbsp; &nbsp;  註冊頁面</h2>10         <div>使用者名稱:<input type="text" name="users"/></div><br />11         <div>密碼:<input type="text" name="pwd"/></div><br />12         <div>姓名:<input type="text" name="name"/></div><br />13         <div>性別:<input type="text" name="sex"/></div><br />14         <div>生日:<input type="text" name="birthday"/></div><br />15         <input type="submit" value="註冊" />16         <a href="denglu.php">已有帳號,立即登入</a>17         </div>18     </form>19     <body>20     </body>21 </html>

2.chuli.php

 1 <?php 2  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 = new DBDA();10 $sql = "insert into users values (‘{$users}‘,‘{$pwd}‘,‘{$name}‘,{$sex},‘{$birthday}‘,0)";11 if($db->query($sql,0)){12 header("location:zhuce.php");    13     14 }15 ?>

 

二.登入功能(denglu.php  login.php )

 

1.denglu.php

 

 1 <!DOCTYPE html> 2 <html> 3     <head> 4         <meta charset="UTF-8"> 5         <title></title> 6     </head> 7     <body> 8         <form method="post" action="login.php"> 9     <div style="margin:100px 500px"> 10             <h2 > &nbsp;&nbsp; &nbsp; &nbsp; 登入頁面</h2>11         <div>使用者名稱:<input type="text" name="users"/></div><br />12         <div>密碼:<input type="text" name="pwd"/></div><br />13         <input type="submit" value="登入" />14         <a href="zhuce.php">沒有帳號,立即註冊</a>15         </div>16     </form>17     </body>18 </html>

 

2.login.php

 

 1 <?php 2  3 $users = $_POST["users"]; 4 $pwd = $_POST["pwd"]; 5 require "DBDA.class1.php"; 6 $db = new DBDA(); 7 $sql = "select * from users where users = ‘{$users}‘"; 8 $arr = $db->query($sql); 9 10 //$arr[0][1] 密碼11 //$arr[0][5] 審核狀態12 13 14 if($arr[0][1] == $pwd && !empty($pwd))15 {16     if($arr[0][5])17     {18         echo "登入成功!";19     }20     else{21         echo "審核未通過!";22     }23 }24 else{25     echo "使用者名稱或密碼錯誤!";26 }27 28 ?>

 

 

三.管理員的審核功能(guanliyuan.php  tongguo.php  chexiao.php)

 

1.guanliyuan.php

 

 1 <!DOCTYPE html> 2 <html> 3     <head> 4         <meta charset="UTF-8"> 5         <title></title> 6     </head> 7  8 <body> 9 <h1>管理員審核</h1>10 <table width="100%" border="1" cellpadding="0" cellspacing="0">11     <tr>12         <td>使用者名稱</td>13         <td>密碼</td>14         <td>姓名</td>15         <td>性別</td>16         <td>生日</td>17         <td>操作</td>18     </tr>19     <?php20     require"DBDA.class1.php";21     $db = new DBDA();22     23     $sql = "select * from users";24     $arr = $db->query($sql);25     26     foreach($arr as $v)27     {28         $str = "";29         if($v[5])30         {31             $str = "<span style=‘color:green‘>已通過</span>32             <a href=‘chexiao.php?uid={$v[0]}‘>撤銷</a>";33         }34         else35         {36             $str = "<a href=‘tongguo.php?uid={$v[0]}‘>通過</a>";37         }38         39         echo "<tr>40         <td>{$v[0]}</td>41         <td>{$v[1]}</td>42         <td>{$v[2]}</td>43         <td>{$v[3]}</td>44         <td>{$v[4]}</td>45         <td>{$str}</td>46     </tr>";47     }48     ?>49 </table>50 </body>51 </html>

 

2.tongguo.php

 

1 <?php2 $uid = $_GET["uid"];3 require "DBDA.class.php";4 $db = new DBDA();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 = new DBDA();5 $sql = "update users set isok=0 where uid=‘{$uid}‘";6 $db->query($sql,0);7 header("location:guanliyuan.php");

 

php資料訪問-註冊審核(重點)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.