關於php註冊審核重點解析-資料訪問詳解

來源:互聯網
上載者:User
這篇文章主要為大家解析了php註冊審核重點,資料進行訪問,具有一定的參考價值,感興趣的小夥伴們可以參考一下

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

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

1.zhece.php

<!DOCTYPE html><html> <head>  <meta charset="UTF-8">  <title></title> </head> <form method="post" action="chuli.php"> <p style="margin:10px 500px">    <h2 >        註冊頁面</h2>  <p>使用者名稱:<input type="text" name="users"/></p><br />  <p>密碼:<input type="text" name="pwd"/></p><br />  <p>姓名:<input type="text" name="name"/></p><br />  <p>性別:<input type="text" name="sex"/></p><br />  <p>生日:<input type="text" name="birthday"/></p><br />  <input type="submit" value="註冊" />  <a href="denglu.php" rel="external nofollow" >已有帳號,立即登入</a>  </p> </form> <body> </body></html>

2.chuli.php

<?php$users = $_POST["users"];$pwd = $_POST["pwd"];$name= $_POST["name"];$sex = $_POST["sex"];$birthday = $_POST["birthday"];require "DBDA.class.php";$db = new DBDA();$sql = "insert into users values ('{$users}','{$pwd}','{$name}',{$sex},'{$birthday}',0)";if($db->query($sql,0)){header("location:zhuce.php");  }?>

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

1.denglu.php

<!DOCTYPE html><html> <head>  <meta charset="UTF-8">  <title></title> </head> <body>  <form method="post" action="login.php"> <p style="margin:100px 500px">    <h2 >        登入頁面</h2>  <p>使用者名稱:<input type="text" name="users"/></p><br />  <p>密碼:<input type="text" name="pwd"/></p><br />  <input type="submit" value="登入" />  <a href="zhuce.php" rel="external nofollow" >沒有帳號,立即註冊</a>  </p> </form> </body></html>

2.login.php

<?php$users = $_POST["users"];$pwd = $_POST["pwd"];require "DBDA.class1.php";$db = new DBDA();$sql = "select * from users where users = '{$users}'";$arr = $db->query($sql);//$arr[0][1] 密碼//$arr[0][5] 審核狀態if($arr[0][1] == $pwd && !empty($pwd)){ if($arr[0][5]) {  echo "登入成功!"; } else{  echo "審核未通過!"; }}else{ echo "使用者名稱或密碼錯誤!";}?>

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

1.guanliyuan.php

<!DOCTYPE html><html> <head>  <meta charset="UTF-8">  <title></title> </head><body><h1>管理員審核</h1><table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr>  <td>使用者名稱</td>  <td>密碼</td>  <td>姓名</td>  <td>性別</td>  <td>生日</td>  <td>操作</td> </tr> <?php require"DBDA.class1.php"; $db = new DBDA();  $sql = "select * from users"; $arr = $db->query($sql);  foreach($arr as $v) {  $str = "";  if($v[5])  {   $str = "<span style='color:green'>已通過</span>   <a href='chexiao.php?uid={$v[0]}'>撤銷</a>";  }  else  {   $str = "<a href='tongguo.php?uid={$v[0]}'>通過</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></body></html>

2.tongguo.php

<?php$uid = $_GET["uid"];require "DBDA.class.php";$db = new DBDA();$sql = "update users set isok=1 where uid='{$uid}'";$db->query($sql,0);header("location:guanliyuan.php");

3.chexiao.php

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