• 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>密码:&nbsp;&nbsp;<input type="text" name="pwd" /></div><br />
    
    <div>姓名:&nbsp;&nbsp;<input type="text" name="name" /></div><br />
    
    <div>性别:&nbsp;&nbsp;<input type="text" name="sex" /></div><br />
    
    <div>生日:&nbsp;&nbsp;<input type="text" name="birthday" /></div><br />
    
    <div><input type="submit" value="注册" />&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="main.php"><input type="button" value="查看" /></a>
    </div>
    
    </form>
    </body>
    </html>
    View Code

    注册数据处理页面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");    
    }
    View Code

     页面显示效果

    登录数据显示页面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>密&nbsp;&nbsp;码:<input type="text" name="pwd" /></div><br />
    
    <div><input type="submit" value="登录" />&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="main.php"><input type="button" value="前去审核" /><a></div>
    </form>
    </body>
    </html>
    View Code

    登录数据处理页面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");
    }
    View Code

     页面显示效果

    审核数据显示页面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'>已通过审核&nbsp;&nbsp;<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>
    View Code

    审核数量处理页面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 "审核未通过";    
    }
    View Code

    撤销审核处理页面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 "撤销失败";    
    }
    View Code

     页面显示效果

  • 相关阅读:
    求长度的另一种方法(""+obj).Length
    XCode中如何使用事务
    最终版 Reflector v1.0 (+简单的反流程混淆)
    与ObjectDataSource共舞
    性能&分布式&NewLife.XCode对无限数据的支持
    XCode之第一次亲密接触
    5,ORM组件XCode(动手)
    你知道吗?多个类多线程环境下静态构造函数的执行顺序
    使用C#编写IDA插件 IDACSharp v1.0.2010.0605
    XCMS V1.0 Beta1 发布
  • 原文地址:https://www.cnblogs.com/Duriyya/p/5519441.html
Copyright © 2020-2023  润新知