PHP development login registration complete code registration HTML page
Create reg.html file
#We have a <form> on this page There are four input boxes in the form. We use JS to make login judgments on the contents of the input boxes, and use CSS to layout the form.
The code is as follows<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登陸界面</title> <script type="text/javascript"> function checkinput() { if(myform.name.value=="") { alert("請輸入用戶名"); myform.name.focus(); return false; } if (myform.pwd.value=="") { alert("請輸入密碼"); myform.pwd.focus(); return false; } if(myform.pwd.value != myform.pwdconfirm.value){ alert("你輸入的兩次密碼不一致,請重新輸入!"); myform.pwd.focus(); return false; } if (myform.yzm.value=="") { alert("請輸入驗(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>用戶注冊</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="注冊" >立即注冊</button></p> </div> </div> </form> </body> </html>