亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

檢查 PHP 表單是否有效以在 3 次嘗試后鎖定用戶

檢查 PHP 表單是否有效以在 3 次嘗試后鎖定用戶

斯蒂芬大帝 2021-05-30 08:47:41
我有一個帶有一些身份驗證和驗證的 php 登錄表單。到目前為止,我想要運行的特定腳本如下:<script type="text/javascript">var login_attempts=3;function check_form() {    //This is where I want the code to check if the form is valid and will be submitted {   alert("SuccessFully Logged In");   //Not sure if I need this as the form contains PHP so if the credentials are correct then tehy go to another page }  else      {       if(login_attempts==0)       {       alert("No Login Attempts Available");       }    else      {      login_attempts=login_attempts-1;      alert("Login Failed Now Only "+login_attempts+" Login Attempts Available");    if(login_attempts==0)       {        document.getElementById("name").disabled=true;        document.getElementById("pass").disabled=true;        document.getElementById("form1").disabled=true;  } }}return false;}   </script>我想要這個的原因是,在用戶嘗試登錄 3 次后,我想要一個警報框顯示一條消息,并阻止用戶在框中輸入任何內容。我實際上不想從數據庫端鎖定帳戶,因為用戶正在對用戶名和密碼以外的信息進行身份驗證。我對 Js 很陌生,如果我錯過了任何東西,我很抱歉
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 163 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號