Le code HTML co...SE CONNECTER

Le code HTML complet de la page d'inscription au développement PHP

Nous ajoutons notre style CSS précédent, notre vérification JS et notre code de vérification pour obtenir une page HTML d'inscription complète

Code complet de la page HTML

Créez le fichier reg.html

<!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("请输入验证码");
                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>确认密码: <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>

Le code ci-dessus est le code complet de notre page d'inscription. L'étape suivante consiste à remplir les informations sur la page d'inscription. et soumettez-le Allez sur la page reg.php, et la page reg.php complétera les informations renseignées par l'utilisateur et les stockera dans la base de données


section suivante
<!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("请输入验证码"); 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>确认密码: <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>
soumettreRéinitialiser le code
chapitredidacticiel