Cliquez pour changer le code de vérification

Nous avons configuré le code de vérification dans la section précédente, mais nous avons constaté que le code de vérification ne peut pas être actualisé. Nous utilisons donc js pour effectuer des opérations simples sur le code de vérification.

onclick="this.src='__CONTROLLER__/verify/'+Math.random();

Déclenchez un événement de clic pour opérer sur le code de vérification.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><!--Head--><head>
    <meta charset="utf-8">
    <title>PHP中文网:交流群374224296</title>
    <meta name="description" content="login page">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--Basic Styles-->
    <link href="__PUBLIC__/style/bootstrap.css" rel="stylesheet">
    <link href="__PUBLIC__/style/font-awesome.css" rel="stylesheet">
    <!--Beyond styles-->
    <link id="beyond-link" href="__PUBLIC__/style/beyond.css" rel="stylesheet">
    <link href="__PUBLIC__/style/demo.css" rel="stylesheet">
    <link href="__PUBLIC__/style/animate.css" rel="stylesheet">
</head>
<!--Head Ends-->
<!--Body-->

<body>
    <div class="login-container animated fadeInDown">
        <form action="" method="post">
            <div class="loginbox bg-white">
                <div class="loginbox-title">登录</div>
                <div class="loginbox-textbox">
                    <input value="admin" class="form-control" placeholder="username" name="username" type="text">
                </div>
                <div class="loginbox-textbox">
                    <input class="form-control" placeholder="password" name="password" type="password">
                </div>
                <div class="loginbox-textbox">
                    <input  class="form-control" style="width:120px; height:50px; float:left;" placeholder="验证码" name="verify" type="text">
                    <img src="__CONTROLLER__/verify" style="cursor:pointer;" onclick="this.src='__CONTROLLER__/verify/'+Math.random();" height="50" width="100" border="0" >
                </div>


                <div class="loginbox-submit">
                    <input class="btn btn-primary btn-block" value="Login" type="submit">
                </div>
            </div>
                <div class="logobox">
                    <p class="text-center">PHP中文网:交流群374224296</p>
                </div>
        </form>
    </div>
    <!--Basic Scripts-->
    <script src="__PUBLIC__/style/jquery.js"></script>
    <script src="__PUBLIC__/style/bootstrap.js"></script>
    <script src="__PUBLIC__/style/jquery_002.js"></script>
    <!--Beyond Scripts-->
    <script src="__PUBLIC__/style/beyond.js"></script>




</body><!--Body Ends--></html>


Formation continue
||
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><!--Head--><head> <meta charset="utf-8"> <title>PHP中文网:交流群374224296</title> <meta name="description" content="login page"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <!--Basic Styles--> <link href="__PUBLIC__/style/bootstrap.css" rel="stylesheet"> <link href="__PUBLIC__/style/font-awesome.css" rel="stylesheet"> <!--Beyond styles--> <link id="beyond-link" href="__PUBLIC__/style/beyond.css" rel="stylesheet"> <link href="__PUBLIC__/style/demo.css" rel="stylesheet"> <link href="__PUBLIC__/style/animate.css" rel="stylesheet"> </head> <!--Head Ends--> <!--Body--> <body> <div class="login-container animated fadeInDown"> <form action="" method="post"> <div class="loginbox bg-white"> <div class="loginbox-title">登录</div> <div class="loginbox-textbox"> <input value="admin" class="form-control" placeholder="username" name="username" type="text"> </div> <div class="loginbox-textbox"> <input class="form-control" placeholder="password" name="password" type="password"> </div> <div class="loginbox-textbox"> <input class="form-control" style="width:120px; height:50px; float:left;" placeholder="验证码" name="verify" type="text"> <img src="__CONTROLLER__/verify" style="cursor:pointer;" onclick="this.src='__CONTROLLER__/verify/'+Math.random();" height="50" width="100" border="0" > </div> <div class="loginbox-submit"> <input class="btn btn-primary btn-block" value="Login" type="submit"> </div> </div> <div class="logobox"> <p class="text-center">PHP中文网:交流群374224296</p> </div> </form> </div> <!--Basic Scripts--> <script src="__PUBLIC__/style/jquery.js"></script> <script src="__PUBLIC__/style/bootstrap.js"></script> <script src="__PUBLIC__/style/jquery_002.js"></script> <!--Beyond Scripts--> <script src="__PUBLIC__/style/beyond.js"></script> </body><!--Body Ends--></html>
soumettreRéinitialiser le code
  • Recommandations de cours
  • Téléchargement du didacticiel
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!