您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關(guān)php如何實(shí)現(xiàn)注冊(cè)審核的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。
一.注冊(cè)功能(zhece.php chuli.php)
1.zhece.php
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <form method="post" action="chuli.php"> <div > <h3 > 注冊(cè)頁(yè)面</h3> <div>用戶名:<input type="text" name="users"/></div><br /> <div>密碼:<input type="text" name="pwd"/></div><br /> <div>姓名:<input type="text" name="name"/></div><br /> <div>性別:<input type="text" name="sex"/></div><br /> <div>生日:<input type="text" name="birthday"/></div><br /> <input type="submit" value="注冊(cè)" /> <a href="denglu.php" rel="external nofollow" >已有賬號(hào),立即登錄</a> </div> </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"> <div > <h3 > 登錄頁(yè)面</h3> <div>用戶名:<input type="text" name="users"/></div><br /> <div>密碼:<input type="text" name="pwd"/></div><br /> <input type="submit" value="登錄" /> <a href="zhuce.php" rel="external nofollow" >沒(méi)有賬號(hào),立即注冊(cè)</a> </div> </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] 審核狀態(tài) if($arr[0][1] == $pwd && !empty($pwd)) { if($arr[0][5]) { echo "登錄成功!"; } else{ echo "審核未通過(guò)!"; } } else{ echo "用戶名或密碼錯(cuò)誤!"; } ?>
三.管理員的審核功能(guanliyuan.php tongguo.php chexiao.php)
1.guanliyuan.php
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <h2>管理員審核</h2> <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'>已通過(guò)</span> <a href='chexiao.php?uid={$v[0]}'>撤銷(xiāo)</a>"; } else { $str = "<a href='tongguo.php?uid={$v[0]}'>通過(guò)</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");
感謝各位的閱讀!關(guān)于“php如何實(shí)現(xiàn)注冊(cè)審核”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。