国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > PHP > 正文

php注冊頁面代碼(mysql+php)

2024-05-04 23:06:12
字體:
供稿:網(wǎng)友

php注冊頁面代碼(mysql+php) 這是一款利用mysql php實例的用戶注冊代碼,比較簡單,就是把html 提交過來的數(shù)據(jù)保存到mysql數(shù)據(jù)庫。

  1. include('global.php'); 
  2.  if($_post['sub']){ 
  3.   $user  = $_post['username']; 
  4.   $pwd   = md5($_post['password1'].$user); 
  5.   $email = $_post['email']; 
  6.    $q = $mysql->query("insert into `hl`.`hl_member`(`id`,`username`,`password`,`email`)values (null,'$user','$pwd','$email');"); 
  7.   if($q){ 
  8.    setcookie('login',$user); 
  9.    $prompt_msg->p('恭喜您,親愛的會員,您已經(jīng)注冊成功!','index.php','現(xiàn)在去首頁。','http://www.111cn.net','先去論壇逛逛!'); 
  10.   }else
  11.    $prompt_msg->p('非常抱歉,系統(tǒng)發(fā)生故障!'); 
  12.   } 
  13.  } 
  14. ?> 
  15. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"
  16. <html xmlns="http://www.111cn.net/1999/xhtml"
  17. <head> 
  18. <meta http-equiv="content-type" content="text/html; charset=gb2312" /> 
  19. <title></title> 
  20. <link rel="stylesheet" type="text/css教程" href="css/reg_log.css" /> 
  21. </head> 
  22. <body> 
  23. <form id="myform" name="myform" method="post" action="register.php"
  24. <div id="top">注冊&nbsp;<a href="login.php">登錄</a></div> 
  25. <div id="content"
  26.  <div class="c1">請?zhí)顚懸韵卤靥钚畔⑼瓿勺?lt;/div> 
  27.     <div class="c2"><span>帶紅色*的都是必填項目,若填寫不全將無法注冊</span></div> 
  28.     <div class="cinput"><dl> 
  29.      <dt>用戶名<font color="red">*</font></dt> 
  30.         <dd><input id="username" name="username" type="text" maxlength="12" /></dd> 
  31.         <dd id="user_prompt" class="prompt">大小寫英文字母、漢字、數(shù)字、下劃線組成的長度 3-12 個字節(jié)以內(nèi)</dd> 
  32.     </dl></div> 
  33.     <div class="cinput"><dl> 
  34.      <dt>密&nbsp;&nbsp;碼<font color="red">*</font></dt> 
  35.         <dd><input id="password1" name="password1" type="password" maxlength="16" /></dd> 
  36.         <dd id="pwd1_prompt" class="prompt">最小長度:6 最大長度:16,僅限字母、數(shù)字及_,字母區(qū)分大小寫</dd> 
  37.     </dl></div>          
  38.     <!--檢測密碼強度--> 
  39.  <div class="cinput" style="padding-bottom:0px;"><!--ie6 hack--> 
  40.      <div class="chkpwd"
  41.          <span id="cp1_prompt" class="cp1"></span><span id="cp2_prompt" class="cp2"></span> 
  42.             <span id="cp3_prompt" class="cp3"></span> 
  43.      </div> 
  44.     </div> 
  45.     <div class="cinput" style="padding-top:0px;"><dl> 
  46.      <dt>確認密碼<font color="red">*</font></dt> 
  47.         <dd><input id="password2" name="password2" type="password" maxlength="16" /></dd> 
  48.         <dd id="pwd2_prompt" class="prompt">請再輸入一遍您上面填寫的密碼</dd> 
  49.     </dl></div> 
  50.     <div class="cinput"><dl> 
  51.      <dt>email<font color="red">*</font></dt> 
  52.         <dd><input id="email" name="email" type="text" /></dd> 
  53.         <dd id="email_prompt" class="prompt">請?zhí)顚懻鎸嵅⑶易畛S玫泥]箱</dd> 
  54.     </dl></div> 
  55.     <div style="clear:both"></div> 
  56. </div> 
  57. <div id="bottom"
  58.  <input class="btn1" type="submit" name="sub" value="提交注冊" id="checkall" /> 
  59.  <input class="btn2" type="reset" name="reset" value="重置" onclick="return sub(this.form)" /> 
  60. </div> 
  61. </form> 
  62. </body> 
  63. </html> 
  64. 數(shù)據(jù)庫結(jié)構(gòu) 
  65.  create table `hl`.`hl_member` ( 
  66. `id` int( 4 ) not null auto_increment comment '自動編碼'
  67. `username` varchar( 100 ) not null comment '用戶名稱'
  68. `password` varchar( 200 ) not null comment '用戶密碼'
  69. `answer` varchar( 100 ) not null comment '密保答案'
  70. `question` varchar( 100 ) not null comment '密保問題'
  71. `email` varchar( 100 ) not null comment 'email'
  72. `realname` varchar( 200 ) not null comment '登錄限制'
  73. `birthday` date not null comment '出生日期'
  74. `telephone` varchar( 20 ) not null comment '電話號碼'
  75. `qq` varchar( 15 ) not null comment 'qq號碼'
  76. `count` int( 1 ) not null comment '登錄限制'
  77. `active` int( 1 ) not null comment '是否激活'
  78. primary key ( `id` ) 
  79. ) engine = innodb character set gb2312 collate gb2312_chinese_ci; 

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 于都县| 聂拉木县| 荆门市| 海原县| 长海县| 桂林市| 恭城| 永新县| 航空| 万山特区| 高安市| 屏南县| 津南区| 洛隆县| 余江县| 郓城县| 石家庄市| 阜平县| 新巴尔虎左旗| 科尔| 乌拉特中旗| 古蔺县| 体育| 陇西县| 项城市| 成武县| 竹溪县| 井陉县| 蒙山县| 宝应县| 庆安县| 静安区| 上杭县| 文成县| 隆子县| 喜德县| 巢湖市| 莱州市| 丹阳市| 雷波县| 沭阳县|