码迷,mamicode.com
首页 > 其他好文 > 详细

注册审核

时间:2016-05-29 15:11:01      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
<!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>
<h3>注册</h3>
<form action="zcchuli.php" method="post">
<div>用户名<input type="text" name="uid" /></div>
<div>密码<input type="text" name="pwd" /></div>
<div>姓名<input type="text" name="name" /></div>
<div>性别<input type="text" name="sex" /></div>
<div>生日<input type="text" name="birthday" /></div>
<div><input type="submit" value="注册"/></div>
</form>




</body>
</html>
注册

 

技术分享

技术分享
<?php
$uid=$_POST["uid"];
$pwd=$_POST["pwd"];
$name=$_POST["name"];
$sex=$_POST["sex"];
$birthday=$_POST["birthday"];
$sex=$sex=="男"?true:false;

include("../DBDA.class.php");
$db=new DBDA();
$sql="insert into users values(‘{$uid}‘,‘{$pwd}‘,‘{$name}‘,‘{$sex}‘,‘{$birthday}‘,false)";
if($db->Query($sql,0))
{
    header("location:denglu.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>
<h3>登陆</h3>
<form action="dlchuli.php" method="post">
<div>用户名<input type="text" name="uid" /></div>
<div>密码<input type="text" name="pwd" /></div>
<div><input type="submit" value="登陆"/></div>
</form>



</body>
</html>


<?php

session_start();
$uid=$_POST["uid"];
$pwd=$_POST["pwd"];
include("../DBDA.class.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:zhuye.php");
    
    }
else{
    header("location:denglu.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>
<h3>审核</h3>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
           <tr>
           <td>姓名</td>
           <td>性别</td>
           <td>生日</td>
           <td>状态</td>
           </tr>
<?php
include("../DBDA.class.php");
$db=new DBDA();
$sql="select * from users";
$attr=$db->Query($sql);
foreach($attr as $v)
{
    $zt="";
    if($v[5])
    {
        $zt="<span>已通过</span><a href=‘chexiao.php?uid=$v[0]‘>撤销</a>";
        }
    else{
        $zt="<a href=‘shenhe.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>
主页面
技术分享
<?php
$uid=$_GET["uid"];
include("../DBDA.class.php");
$db = new DBDA();
$sql="update users set isok=true where uid=‘{$uid}‘";
if($db->Query($sql,0))
{
    header("location:zhuye.php");
    
    }
else{
    echo"审核失败!";
    
    }




?>
审核
技术分享
<?php
$uid=$_GET["uid"];
include("../DBDA.class.php");
$db = new DBDA();
$sql="update users set isok=false where uid=‘{$uid}‘";
if($db->Query($sql,0))
{
    header("location:zhuye.php");
    
    }
else{
    echo"撤销失败!";
    
    }




?>
撤销审核

 

技术分享

注册审核

标签:

原文地址:http://www.cnblogs.com/yuchao19950412/p/5539401.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!