The complete HTML code of the PHP development registration page
We add our previous css style, JS verification, and verification code together to form a complete registration HTML page
Full code of HTML page
Create reg.html file
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登陸界面</title> <script type="text/javascript"> function checkinput() { if(myform.name.value=="") { alert("請(qǐng)輸入用戶名"); myform.name.focus(); return false; } if (myform.pwd.value=="") { alert("請(qǐng)輸入密碼"); myform.pwd.focus(); return false; } if(myform.pwd.value != myform.pwdconfirm.value){ alert("你輸入的兩次密碼不一致,請(qǐng)重新輸入!"); myform.pwd.focus(); return false; } if (myform.yzm.value=="") { alert("請(qǐng)輸入驗(yàn)證碼"); myform.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); } .right { position: relative; left: 40px; top: 20px; } 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; } </style> </head> <body> <form action="reg.php" method="post" name="myform" onsubmit=" return checkinput();" > <div class="container"> <div class="right"> <h2>用戶注冊(cè)</h2> <p>用 戶 名:<input type="text" name="name" id="name"></p> <p>密 碼: <input type="password" name="pwd" id="pwd"></p> <p>確認(rèn)密碼: <input type="password" name="pwdconfirm" id="pwdconfirm"></p> <p>驗(yàn) 證 碼:<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="注冊(cè)" >立即注冊(cè)</button></p> </div> </div> </form> </body> </html>
The above code is our complete registration page code. The next step is that we fill in the information on the registration page and submit it. Go to the reg.php page, and the reg.php page will complete the information filled in by the user and store it in the database