zoukankan      html  css  js  c++  java
  • 12-29 注册审核

    <h1>注册页面</h1>
    <form action="zhucechili.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>
    <input type="submit" value="注册" />
    </form>

    注册处理页面

    <?php
    $uid = $_POST["uid"];
    $pwd = $_POST["pwd"];
    $name = $_POST["name"];
    $sex = $_POST["sex"];
    $birthday = $_POST["birthday"];

    include("../fengzhuang/DBDA.class.php");
    $db = new DBDA();

    $sql = "insert into users values('{$uid}','{$pwd}','{$name}',{$sex},'{$birthday}',0,'')";

    $db->Query($sql,0);

    header("location:login.php");

    登陆界面

    <form action="loginchuli.php" method="post">
    <div>用户名:<input type="text" name="uid" /></div>
    <div>密码:<input type="password" name="pwd" /></div>
    <input type="submit" value="登录" />
    </form>

    效果:

    登陆处理界面

    <?php
    $uid = $_POST["uid"];
    $pwd = $_POST["pwd"];

    include("../fengzhuang/DBDA.class.php");
    $db = new DBDA();

    $sql = "select pwd from users where uid='{$uid}'";

    $attr = $db->Query($sql);

    if(!empty($pwd) && !empty($attr) && $attr[0][0] == $pwd)
    {
    //密码正确,判断状态
    $szt = "select isok from users where uid='{$uid}'";
    $azt = $db->Query($szt);
    if($azt[0][0])
    {
    echo "可以登录";
    }
    else
    {
    echo "未通过审核!";
    }
    }
    else
    {
    //密码错误
    echo "密码不对";
    }

     审核页面

    <h1>审核页面</h1>

    <table width="100%" border="1" cellpadding="0" cellspacing="0">

    <tr>
    <th>用户名</th>
    <th>密码</th>
    <th>姓名</th>
    <th>性别</th>
    <th>生日</th>
    <th>状态</th>
    </tr>

    <?php
    include("../fengzhuang/DBDA.class.php");
    $db = new DBDA();

    $sql = "select * from users";
    $attr = $db->Query($sql);
    foreach($attr as $v)
    {
    $zt = $v[5];
    $str = "";
    if($zt)
    {
    $str = "<span style=' color:green'>已通过</span><a href='bohui.php?uid={$v[0]}'>驳回</a>";
    }
    else
    {
    $str = "<a href='tongguo.php?uid={$v[0]}'>通过</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>

    通过处理页面

    <?php

    $uid = $_GET["uid"];

    include("../fengzhuang/DBDA.class.php");
    $db = new DBDA();

    $sql = "update users set isok=1 where uid='{$uid}'";
    $db->Query($sql,0);

    header("location:shenhe.php");

    驳回页面

    <?php

    $uid = $_GET["uid"];

    include("../fengzhuang/DBDA.class.php");
    $db = new DBDA();

    $sql = "update users set isok=0 where uid='{$uid}'";
    $db->Query($sql,0);

    header("location:shenhe.php");

  • 相关阅读:
    【编程基础】const与#define的区别
    【Unity3D】模仿制作“神庙逃亡”吃金币后金币飞出屏幕效果
    【基础数学】素数判定、素数打表
    【NYOJ-187】快速查找素数—— 枚举法、筛选法、打表法
    【基础数学】质数,约数,分解质因数,GCD,LCM
    【NYOJ-35】表达式求值——简单栈练习
    【UVa-679】小球下落——二叉树的编号
    【UVa-442】矩阵链乘——简单栈练习
    【UVa-514】铁轨——栈的学习
    gitignore git提交忽略文件
  • 原文地址:https://www.cnblogs.com/F4natasy/p/6233105.html
Copyright © 2011-2022 走看看