PHP实现注册登录

来源:互联网 发布:弱智保姆软件 编辑:程序博客网 时间:2024/05/17 08:52

一、主页index.php

<!DOCTYPE html><html><head>    <title>会员系统</title>    <meta charset="utf-8">    <link rel="stylesheet" type="text/css" href="style.css">    <style type="text/css">        h3,div.start,div.reg,div.login{margin: 20px; text-align: center}    </style></head><body><?php    if(isset($_GET['index'])){        include $_GET['index'].'.inc.php';    }else{        include 'start.inc.php';    }?></body></html>

二、起始页start.inc.php
这里写图片描述

<h3>欢迎光临会员俱乐部</h3><div class = "start">    <a href="index.php?index=login">登录</a>  <!-- ?后第一个是变量 -->    <a href="index.php?index=reg">注册</a></div>

三、登录页login.inc.php
这里写图片描述

<h3>请登录您的账号</h3>    <div class="login">        <form>            <p>用户名:<input type="text" name="username"></p>            <p>密  码:<input type="password" name="password"></p>            <p><input type="submit" name="login" value="登录"></p>            <p><a href="?">[返回上一层]</a></p>        </form>    </div>

四、注册页reg.inc.php
这里写图片描述

<h3>请注册你的个人信息表</h3><div class="reg">    <form action=""  method="get">        <p>用户名:<input type="text" name="username"></p>        <p>密  码:<input type="password" name="password"></p>        <p>密码确认:<input type="password" name="password"></p>        <p>电子邮件:<input type="text" name="email"></p>        <p><input type="submit" name="send" value="注册"></p>        <p><a href="?">[返回上一层]</a></p>    </form></div>
原创粉丝点击