zoukankan      html  css  js  c++  java
  • 面向过程的 登录与注册

    文件布局



    <!--index.php-->
    <meta http-equiv="content-type" content="text/html" charset="utf-8">
    <?php
    /**
    * Created by PhpStorm.
    * User: Administrator
    * Date: 2015/8/26
    * Time: 9:47
    */

    ?>
    <!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" xml:lang="en" lang="en">
    <head>
    <title>会员系统</title>
    <link rel="stylesheet" type="text/css" href="style.css"/>
    </head>
    <body>

    <?php require 'start.inc.php'?>

    <?php
    if(isset($_GET['index'])){
    if($_GET['index']=='login'){
    include $_GET['index'].'.inc.php';
    }elseif($_GET['index']=='register'){
    include $_GET['index'].'.inc.php';
    }
    }
    ?>

    </body>
    </html>

    <!--start.inc.php-->
    <h3>欢迎光临会员俱乐部</h3>

    <div class="start">
    <a href="index.php?index=login">登录</a>
    <a href="index.php?index=register">注册</a>
    </div>


    <!--login.inc.php-->
    <h3>请登录您的账号</h3>

    <div class="login">
    <form method="post" action="">
    <p>用 户 名:<input type="text" name="username"></p>
    <p>密&nbsp;&nbsp;码:<input type="password" name="password"></p>
    <p><input type="submit" name="login" value="登录"></p>
    <p>[<a href="?">返回上一层</a>]</p>
    </form>
    </div>


    <!--register.inc.php-->
    <h3>请注册您的信息</h3>

    <div class="register">
    <form method="post" action="">
    <p>用 户 名:<input type="text" name="username"></p>
    <p>密&nbsp;&nbsp;码:<input type="password" name="password"></p>
    <p>确认密码:<input type="password" name="notpassword"></p>
    <p>电子邮件:<input type="text" name="email"></p>
    <p><input type="submit" name="register" value="注册"></p>
    <p>[<a href="?">返回上一层</a>]</p>
    </form>
    </div>


    <!--style.css-->
    @CHARSET "UTF-8";
    h3,.start,.register,.login{
    margin: 20px;
    text-align: center;
    }
  • 相关阅读:
    1004. Counting Leaves (30)
    51Nod 1272 最大距离 (栈或贪心)
    D
    M
    N
    F
    E
    L
    A. Office Keys ( Codeforces Round #424 (Div. 1, rated, based on VK Cup Finals) )
    K
  • 原文地址:https://www.cnblogs.com/xiaomingzaixian/p/4760101.html
Copyright © 2011-2022 走看看