PHP開發註冊頁面之初識

相信大家對於註冊頁面也不陌生,註冊頁面就是讓用戶填寫一些信息,什麼用戶名,密碼,電子郵箱,性別等等都是在我們的註冊頁面進行。我們今天就教大家怎麼做註冊頁面


先看一下下面的註冊頁面圖片

4.jpg

上圖就是我們比較簡單的註冊頁面,比我們前面所做的登入頁面多了一個確認密碼,是為了防止使用者兩次輸入的密碼不一樣,導緻密碼錯誤,我們下章節開始來做我們的HTML頁面


#提示:我們為大家示範的註冊頁面是最簡單的註冊頁面,上面只有用戶名和密碼的,但在我們日常生活遇到的註冊頁面,都包括什麼手機號碼,電子郵箱,什麼的,等大家熟悉了程序,相信大家可以做出豐富多彩的頁面


#創建我們所需的文件

#處理接收reg.html頁面傳過來的數據,將資料儲存到user資料表中
檔名reg.htmlreg.php#yanzhengma.php


##主要功能


#前台註冊頁面


驗證碼程式


繼續學習
||
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登陆界面</title> <script type="text/javascript"> function checkinput() { if($('#name').val() == ''){ alert("你的用户名不能为空"); $('#name').focus(); return false; } if($('#pwd').val() == ''){ alert("你的密码不能为空"); $('#pwd').focus(); return false; } if($('#pwd').val() != $('#pwdconfirm').val()){ alert("你输入的两次密码不一致,请重新输入!"); $('#pwd').focus(); return false; } if($('#yzm').val() == ''){ alert("你的验证码不能为空"); $('#yzm').focus(); return false; } } </script> <style type="text/css"> body{background-color: rgba(223, 255, 231, 0.28) } .container{ border-radius: 25px; box-shadow: 0 0 20px #222; width: 380px; height: 400px; margin: 0 auto; margin-top: 200px; background-color: rgba(152, 242, 242, 0.23); } input{ width: 180px; height: 25px; } button{ background-color: rgba(230, 228, 236, 0.93); border: none; color: #110c0f; padding: 10px 70px; text-align: center; display: inline-block; font-size: 16px; cursor: pointer; margin-top: 30px; margin-left: 50px; } div.right { position: relative; left: 40px; top: 20px; } </style> </head> <body> <form action="" method="post" onsubmit=" return checkinput();" > <div class="container"> <div class="right"> <h2>用户注册</h2> <p>用 户 名:<input type="text" name="name" id="name"></p> <p>密  码: <input type="password" name="pwd" id="pwd"></p> <p>确认密码: <input type="password" name="pwdconfirm" id="pwdconfirm"></p> <p>验 证 码:<input type="text" name="yzm" id="yzm"> <img src="yanzhengma.php" onClick="this.src='yanzhengma.php?nocache='+Math.random()" style="cursor:hand"></p> <p><button type="submit" value="注册" >立即注册</button></p> </div> </div> </form> </body> </html>
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!