5月23 注册审核
Posted Durriya
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了5月23 注册审核相关的知识,希望对你有一定的参考价值。
注册数据显示页面zhuce.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>注册审核</title> </head> <body> <h1>注册</h1> <form action="zhucechuli.php" method="post"> <div>用户名:<input type="text" name="uid" /></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 /> <div><input type="submit" value="注册" /> <a href="main.php"><input type="button" value="查看" /></a> </div> </form> </body> </html>
注册数据处理页面zhucechuli.php
<?php $uid = $_POST["uid"]; $pwd = $_POST["pwd"]; $name = $_POST["name"]; $sex = $_POST["sex"]; $birthday = $_POST["birthday"]; //处理性别 $s = 1; if($sex=="女") { $s = 0; } include("../DBDA.php"); $db = new DBDA(); $sql = "insert into users values(\'{$uid}\',\'{$pwd}\',\'{$name}\',{$s},\'{$birthday}\',\'\',false)"; //echo $sql; if($db->Query($sql,1)) { header("location:zhuce.php"); }
页面显示效果
登录数据显示页面login.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>注册审核</title> </head> <body> <h1>登录</h1> <form action="loginchuli.php" method="post"> <div>用户名:<input type="text" name="uid" /></div><br /> <div>密 码:<input type="text" name="pwd" /></div><br /> <div><input type="submit" value="登录" /> <a href="main.php"><input type="button" value="前去审核" /><a></div> </form> </body> </html>
登录数据处理页面loginchuli.php
<?php session_start(); $uid = $_POST["uid"]; $pwd = $_POST["pwd"]; include("../DBDA.php"); $db = new DBDA(); $sql = "select count(*) from users where Uid = \'{$uid}\' and Pwd = \'{$pwd}\' and Isok =true"; $r = $db->StrQuery($sql); if($r==1) { $_SESSION["uid"] = $uid; header("location:main.php"); } else { header("location:login.php"); }
页面显示效果
审核数据显示页面main.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>注册审核</title> </head> <body> <h1>审核</h1> <table width="100%" cellpadding="0" cellspacing="0" border="1"> <tr> <td>姓名</td> <td>性别</td> <td>生日</td> <td>操作</td> </tr> <?php include("../DBDA.php"); $db = new DBDA(); $sql = "select * from users"; $attr = $db->Query($sql); foreach($attr as $v) { //审查的状态 $zt = ""; if($v[6]) { $zt = "<span style=\'color:red\'>已通过审核 <a href=\'chexiao.php?uid={$v[0]}\'>撤销</a></span>"; } else { $zt = "<a href=\'mainchuli.php?uid={$v[0]}\'>审核</a>"; } echo "<tr> <td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$v[4]}</td> <td>{$zt}</td> </tr>"; } ?> </table> </body> </html>
审核数量处理页面mainchuli.php
<?php $uid = $_GET["uid"]; include("../DBDA.php"); $db = new DBDA(); $sql = "update users set Isok = true where Uid = \'{$uid}\'"; if($db->Query($sql,1)) { header("location:main.php"); } else { echo "审核未通过"; }
撤销审核处理页面chexiao.php
<?php $uid = $_GET["uid"]; include("../DBDA.php"); $db = new DBDA(); $sql = "update users set Isok = false where Uid = \'{$uid}\'"; if($db->Query($sql,1)) { header("location:main.php"); } else { echo "撤销失败"; }
页面显示效果
以上是关于5月23 注册审核的主要内容,如果未能解决你的问题,请参考以下文章