• 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="zhuceshenhechuli.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="submit" value="注册" /></div>
    </form>
    </body>
    </html>
    View Code
    <?php
    include("DBDA.php");
    $db = new DBDA();
    
    $uid = $_POST["uid"];
    $pwd = $_POST["pwd"];
    $name = $_POST["name"];
    $sex = $_POST["sex"]=="男"?true:false;
    
    $sql = "insert into users values('{$uid}','{$pwd}','{$name}',{$sex},false,'')";
    
    if($db->Query($sql,0))
    {
        header("location:zhuceshenhe.php");
    }
    else
    {
        echo "注册失败!";
    }
    View Code

    登陆界面

    <!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="zheceshenhechuli2.php" method="post">
        <div>用户名:<input type="text" name="uid" /></div>
        <div>密码:<input type="password" name="pwd" /></div>
        <input type="submit" value="登录" />
    </form>
    </body>
    </html>
    View Code
    <?php
    session_start();
    include("DBDA.php");
    $db = new DBDA();
    
    $uid = $_POST["uid"];
    $pwd = $_POST["pwd"];
    
    $sql = "select pwd from users where uid = '{$uid}'";
    $mima = $db->StrQuery($sql);
    
    $sqlzt = "select isok from users where uid='{$uid}'";
    $zt = $db->StrQuery($sqlzt);
    
    
    if($uid != "" && $pwd != "")
    {
        if($pwd == $mima && $zt==1)
        {
            $_SESSION["uid"] = $uid;
            header("location:zhucechuli3.php");
        }
        else
        {
            echo "用户名或密码错误或未审核通过";
        }
    }
    else
    {
        echo "用户名或密码错误";
    }
    View Code

    审核界面

    <!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>
    <?php
    session_start();
    include("DBDA.php");
    $db = new DBDA();
    
    if(empty($_SESSION["uid"]))
    {
        header("location:zhuceshenhe2.php");
        exit;
    }
    
    ?>
    
    <body>
    <h1>审核页面</h1>
    <table width="100%" border="1" cellpadding="0" cellspacing="0">
        <tr>
            <td>用户名</td>
            <td>姓名</td>
            <td>性别</td>
            <td>操作</td>
        </tr>
        <?php
        $sql = "select * from users"; 
        $attr = $db->Query($sql);
        foreach($attr as $v)
        {
            //处理性别
            $sex = $v[3]?"男":"女";
            //处理操作
            $caozuo = $v[4]?"<span style='background-color:green'>已通过</span>":"<a href='zheceshenhechuli3.php?uid={$v[0]}'>审核</a>";
            
            echo "<tr>
            <td>{$v[0]}</td>
            <td>{$v[2]}</td>
            <td>{$sex}</td>
            <td>{$caozuo}</td>
        </tr>";
        }
        ?>
    </table>
    </body>
    </html>
    View Code
    <?php
    include("DBDA.php");
    $db = new DBDA();
    
    $uid = $_GET["uid"];
    
    $sql = "update users set isok=true where uid='{$uid}'";
    $db->Query($sql,0);
    
    header("location:zhuceshenhe3.php");
    View Code
  • 相关阅读:
    iOS开发之Masonry框架源码解析
    iOS开发针对对Masonry下的FPS优化讨论
    React-native Android环境搭建
    Android中ListView使用总结
    Android开发布局方式
    轮播图
    大文件断点下载
    基于第三方库FMDB的数据库的二次封装
    md5加密
    AssignToObject文件(字典转模型、字典数组转模型数组)
  • 原文地址:https://www.cnblogs.com/bilibiliganbei/p/5639403.html
Copyright © 2020-2023  润新知