php注册页面代码(mysql+php)
发布:smiling 来源: PHP粉丝网 添加日期:2013-12-11 14:15:14 浏览: 评论:0
php注册页面代码(mysql+php) 这是一款利用mysql php实例的用户注册代码,比较简单,就是把html 提交过来的数据保存到mysql数据库。
- include('global.php');
- if($_post['sub']){
- $user = $_post['username'];
- $pwd = md5($_post['password1'].$user);
- $email = $_post['email'];
- $q = $mysql->query("insert into `hl`.`hl_member`(`id`,`username`,`password`,`email`)values (null,'$user','$pwd','$email');");
- if($q){
- setcookie('login',$user);
- $prompt_msg->p('恭喜您,亲爱的会员,您已经注册成功!','index.php','现在去首页。','http://www.111cn.net','先去论坛逛逛!');
- }else{
- $prompt_msg->p('非常抱歉,系统发生故障!');
- }
- }
- ?>
- <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
- <html xmlns="http://www.111cn.net/1999/xhtml">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=gb2312" />
- <title></title>
- <link rel="stylesheet" type="text/css教程" href="css/reg_log.css" />
- </head>
- <body>
- <form id="myform" name="myform" method="post" action="register.php">
- <div id="top">注册 <a href="login.php">登录</a></div>
- <div id="content">
- <div class="c1">请填写以下必填信息完成注册</div>
- <div class="c2"><span>带红色*的都是必填项目,若填写不全将无法注册</span></div>
- <div class="cinput"><dl>
- <dt>用户名<font color="red">*</font></dt>
- <dd><input id="username" name="username" type="text" maxlength="12" /></dd>
- <dd id="user_prompt" class="prompt">大小写英文字母、汉字、数字、下划线组成的长度 3-12 个字节以内</dd>
- </dl></div>
- <div class="cinput"><dl>
- <dt>密 码<font color="red">*</font></dt>
- <dd><input id="password1" name="password1" type="password" maxlength="16" /></dd>
- <dd id="pwd1_prompt" class="prompt">最小长度:6 最大长度:16,仅限字母、数字及_,字母区分大小写</dd>
- </dl></div>
- <!--检测密码强度-->
- <div class="cinput" style="padding-bottom:0px;"><!--ie6 hack-->
- <div class="chkpwd">
- <span id="cp1_prompt" class="cp1"></span><span id="cp2_prompt" class="cp2"></span>
- <span id="cp3_prompt" class="cp3"></span>
- </div>
- </div>
- <div class="cinput" style="padding-top:0px;"><dl>
- <dt>确认密码<font color="red">*</font></dt>
- <dd><input id="password2" name="password2" type="password" maxlength="16" /></dd>
- <dd id="pwd2_prompt" class="prompt">请再输入一遍您上面填写的密码</dd>
- </dl></div>
- <div class="cinput"><dl>
- <dt>email<font color="red">*</font></dt>
- <dd><input id="email" name="email" type="text" /></dd>
- <dd id="email_prompt" class="prompt">请填写真实并且最常用的邮箱</dd>
- </dl></div>
- <div style="clear:both"></div>
- </div>
- <div id="bottom">
- <input class="btn1" type="submit" name="sub" value="提交注册" id="checkall" />
- <input class="btn2" type="reset" name="reset" value="重置" onclick="return sub(this.form)" />
- </div>
- </form>
- </body>
- </html>
- 数据库结构
- create table `hl`.`hl_member` (
- `id` int( 4 ) not null auto_increment comment '自动编码',
- `username` varchar( 100 ) not null comment '用户名称',
- `password` varchar( 200 ) not null comment '用户密码',
- `answer` varchar( 100 ) not null comment '密保答案',
- `question` varchar( 100 ) not null comment '密保问题',
- `email` varchar( 100 ) not null comment 'email',
- `realname` varchar( 200 ) not null comment '登录限制',
- `birthday` date not null comment '出生日期',
- `telephone` varchar( 20 ) not null comment '电话号码',
- `qq` varchar( 15 ) not null comment 'qq号码',
- `count` int( 1 ) not null comment '登录限制',
- `active` int( 1 ) not null comment '是否激活',
- primary key ( `id` )
- ) engine = innodb character set gb2312 collate gb2312_chinese_ci;
Tags: 注册 页面 代码 mysql+php
- 上一篇:PHP设计聊天室步步通(四)
- 下一篇:php 用户注册页面代码
相关文章
- ·php 用户注册页面代码(2013-12-11)
- ·PHP+MySQL注册登陆代码(2014-05-12)
- ·ajax+php无刷新回贴和注册检验实例(2014-07-05)
- ·php+ajax注册验证实例(完整代码)(2015-04-10)
- ·简单的php用户注册入库例子(2016-08-18)
- ·PHP制作用户注册系统(2021-06-20)
- ·php生成静态页面程序(2014-01-16)
- ·php基于文件系统的页面计数器范例(2014-08-18)
- ·php写的网页计数器代码(2013-12-11)
- ·php登录代码(2013-12-16)
- ·完整的新闻无限级分类代码,可添加,删除,移动,修改(2014-01-15)
- ·php用户登录代码(2014-01-15)
- ·利用cookie 实现访问次数统计代码(2014-01-15)
- ·php发送邮件代码-用mail(2014-01-21)
- ·php与mysql留言板程序实现代码(2014-07-25)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)