• 注册审核


    注册页面代码

    <!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="zcchuli.php" method="post">
    <div>代号:<input type="text" name="uid" /></div>
    <div>密码:<input type="text" name="mima" /></div>
    <div>名字:<input type="text" name="name" /></div>
    <div>性别:<input type="text" name="sex" /></div>
    <div>生日:<input type="text" name="shengri" /></div>
    <input type="submit" value="注册" />
    </form>
    
    </body>
    </html>
    

      页面显示

    注册处理页面代码

    <?php
    include("../DBDA.php");
    $db= new DBDA();
    $uid=$_POST["uid"];
    $mima=$_POST["mima"];
    $name=$_POST["name"];
    $sex=$_POST["sex"]=="男"?1:0;
    $sr=$_POST["shengri"];
    
    $sql="insert into ren values('{$uid}','{$mima}','{$name}',{$sex},'{$sr}',false)";
    if($db->Query($sql,0))
    {
    	header("location:denglu.php");
    }
    else
    {
    	echo"注册失败";
    }
    

      注册成功进入登录页面,失败显示注册失败

    登录页面代码

    <!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="dlchuli.php" method="post">
    <div>用户名:<input type="text" name="uid"/></div>
    <div>密码:<input type="text" name="mima"/></div>
    <input type="submit" value="登录" />
    </form>
    
    
    
    </body>
    </html>
    

      页面显示

    登录处理代码

    <?php
    session_start();
    include("../DBDA.php");
    $db= new DBDA();
    $uid=$_POST["uid"];
    $mima=$_POST["mima"];
    $sql="select * from ren where uid='{$uid}'";
    $mm=$db->Query($sql);
    if($uid!=""&&$mima!="")
    {
    	if($mima==$mm[0][1] && $mm[0][5]==1)
    	{
    		$_SESSION["uid"]=$uid;
    		header("location:shenhe.php");
    	}
    	else
    	{
    		echo"登录失败或未审核";
    	}
    }
    else
    {
    	echo"登录失败";
    }
    

      登录成功跳转审核页面,失败显示登录失败或未审核

    审核页面代码

    <!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>
    <?php
    session_start();
    include("../DBDA.php");
    $db=new DBDA();
    
    if(empty($_SESSION["uid"]))
    {
    	header("location:denglu.php");
    	exit;//跳出判断
    }
    ?>
    <h1>审核页面</h1>
    </br>
    <table width="100%" border="1" cellpadding="0" cellspacing="0">
      <tr>
        <td>代号</td>
        <td>名字</td>
        <td>性别</td>
        <td>生日</td>
        <td>操作</td>  
      </tr>
      <?php
      $sql="select * from ren";
      $zhi=$db->Query($sql);
      foreach($zhi as $v)
      {
    	  //处理性别
    	  $sex=$v[3]==1?"男":"女";
    	  //处理操作内容
    	  $caozuo=$v[5]==1?"<span style='background-color:green'>审核通过</span>":"<a href='shchuli.php?uid={$v[0]}'>审核</a>";
    	echo"<tr>
             <td>{$v[0]}</td>
             <td>{$v[2]}</td>
             <td>{$sex}</td>
             <td>{$v[4]}</td>
             <td>{$caozuo}</td>  
             </tr>";
      }
      ?>
      
    </table>
    
    
    </body>
    </html>
    

      页面显示

    审核处理页面

    <?php
    include("../DBDA.php");
    $db=new DBDA();
    $uid=$_GET["uid"];
    $sql="update ren set caozuo=true where uid='{$uid}'";
    $db->Query($sql,0);
    
    header("location:shenhe.php");
    

      

  • 相关阅读:
    SQL基本之增删查改操作
    【转】C++静态库与动态库
    使用日志记录功能查看PHP扩展的执行过程
    写一个打印日志的函数
    写一个CGI程序并运行
    gcc及其选项详解 【转载】
    Linux下gcc编译生成动态链接库*.so文件并调用它【转载】
    Laravel框架开发规范-修订版
    Laravel框架开发规范-修订前期版
    基本语句优化10个原则
  • 原文地址:https://www.cnblogs.com/wcc731546227/p/5638896.html
Copyright © 2020-2023  润新知