zoukankan      html  css  js  c++  java
  • 模块化初始注册登录页面

    代码块——模块化加载页面,减少了重复冗余的代码

    index.php页面代码(根据传过来的参数选择,需要加载注册页面还是登录页面或者主页面)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <meta http-equiv=Content-Type content="text/html;charset=utf-8"/>
    <link rel="stylesheet" Type="text/css" href="style/index.css"/>
    <title>会员登陆系统界面</title>
    </head>
    <body>
    <?php
    if (isset($_GET['init'])) {    //判断是否传参,若有根据参数进行跳转,若没有表示第一次打开主页面
     include $_GET['init'].'.inc.php';
    }else {
     include 'start.inc.php';
    }
    ?>
    </body>
    </html>

    start.inc.php 导入的主代码块 让你选择登录还是注册

    <div class="start">
    <h2>会员登陆系统界面</h2>

    <a href="index.php?init=login">登陆</a>|
    <a href="index.php?init=reg">注册</a>
    </div>

    login.inc.php代码块 登录模块

    <div class="login">
    <h2>会员登陆</h2>
    <form action="login.php">
    <table>
    <tr><td>用户名</td><td><input type="text" name="userid"/></td></tr>
    <tr><td>密&nbsp;码</td><td><input type="password" name="password"/></td></tr>
    <tr><td><input type="submit" name="submit" value="登陆"/></td><td><input type="reset" name="reset" value="重置"/></td></tr>
    <tr><td>[<a href="?">返回上一页面</a>]</td></tr>
    </table>
    </form>
    </div>

    reg.inc.php 注册代码块

    <div class="reg">
    <h2>会员注册</h2>
    <form action="reg.php">
    <table>
    <tr><td>用户名</td><td><input type="text" name="userid" size="20"/></td></tr>
    <tr><td>密&nbsp;码</td><td><input type="password" name="password" size="20"/></td></tr>
    <tr><td>确认密码</td><td><input type="password" name="repassword" size="20"/></td></tr>
    <tr><td>性&nbsp;别</td><td><input type="radio" name="sex" value="男"/><input type="radio" name="sex" value="女"/></td></tr>
    <tr><td>邮&nbsp;箱</td><td><input type="text" name="email" size="20"/></td></tr>
    <tr><td><input type="submit" name="submit" value="登陆"/></td><td><input type="reset" name="reset" value="重置"/></td></tr>
    <tr><td>[<a href="?">返回上一页面</a>]</td></tr>

    </table>//此处超链接中的问号表示清除http 中传的参数,所以返回上一页,也可以写成index.php,若什么也不写表示本页跳转
    </form>
    </div>

  • 相关阅读:
    springboot 整合jdbcTemplate
    springboot 整合springDataJPA
    springboot 全局异常处理
    springboot整合jsp模板
    springboot整合mybatis+pageHelper
    springboot整合mybatis
    springboot使用fastJson作为json解析框架
    springBoot开启热部署
    springboot快速入门
    解决springboot启动失败问题:Unable to start embedded container;
  • 原文地址:https://www.cnblogs.com/jiechn/p/3687298.html
Copyright © 2011-2022 走看看