Home  >  Article  >  Backend Development  >  PHP registration page code (mysql+php)_PHP tutorial

PHP registration page code (mysql+php)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:58:001502browse

php注册页面代码(mysql+php) 这是一款利用mysql php实例的用户注册代码,比较简单,就是把html 提交过来的数据保存到mysql数据库。

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.bKjia.c0m','先去论坛逛逛!');
  }else{
   $prompt_msg->p('非常抱歉,系统发生故障!');
  }
 }
?>








注册 登录


 
请填写以下必填信息完成注册

   
带红色*的都是必填项目,若填写不全将无法注册

   

     
用户名*

       

       
大小写英文字母、汉字、数字、下划线组成的长度 3-12 个字节以内

   

   

     
密 码*

       

       
最小长度:6 最大长度:16,仅限字母、数字及_,字母区分大小写

   
         
   
 

     

         
           
     

   


Confirm password*

                                                                                                                                                                                               input id="password2" name="password2" type="password" maxlength="16" />
           
Please enter the password you filled in above again



email*

                                                                                                                                                                    
Please fill in your real and most commonly used email address











Database structure

create table `hl`.`hl_member` (

`id` int( 4 ) not null auto_increment comment 'automatic encoding',
`username` varchar( 100 ) not null comment 'username',
`password` varchar( 200 ) not null comment 'user password',
`answer` varchar( 100 ) not null comment 'Secret answer',
`question` varchar( 100 ) not null comment 'Secret question',
`email` varchar( 100 ) not null comment 'email',
`realname` varchar( 200 ) not null comment 'Login restriction',
`birthday` date not null comment 'birthday',
`telephone` varchar( 20 ) not null comment 'phone number',
`qq` varchar( 15 ) not null comment 'qq number',
`count` int( 1 ) not null comment 'Login limit',
`active` int( 1 ) not null comment 'whether to activate',
primary key ( `id` )
) engine = innodb character set gb2312 collate gb2312_chinese_ci;

http://www.bkjia.com/PHPjc/632049.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632049.htmlTechArticlephp registration page code (mysql+php) This is a user registration code using mysql php instance, which is relatively simple , which is to save the data submitted by html to the mysql database. php tutorial registration...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn