PHP根據密碼長度顯示安全條執行個體

來源:互聯網
上載者:User
本文主要給大家分享php根據密碼長度顯示安全條功能,代碼簡單易懂,非常不錯,具有參考借鑒價值,需要的的朋友參考下吧,希望能協助到大家。


//根據密碼長度顯示安全條          <ul class="clear">          <li>密  碼:</li>          <li> <input type="password" id="pwd" name="pwd" class="in" onKeyUp=pwStrength(this.value) onBlur=pw_y("pwd","pwd1")></li>          <li><em class="red">*</em></li>          <li class="i2 grey"><table border="0" bordercolor="#cccccc" style='display:marker'>          <tr align="center">            <td id="strength_L" bgcolor="#eeeeee">弱</td>            <td id="strength_M" bgcolor="#eeeeee">中</td>            <td id="strength_H" bgcolor="#eeeeee">強</td>          <td align="left" >           <label id="pwd1">使用數字,字母,底線,長度在 6 - 20 個字元之間</label></td>            </tr>          </table>                   </li>          </ul>function pwStrength(pwd){  O_color="#eeeeee";  L_color="#FF0000";  M_color="#FF9900";  H_color="#33CC00";  if (pwd==null||pwd==''){    Lcolor=Mcolor=Hcolor=O_color;  }else{    S_level=checkStrong(pwd);    switch(S_level) {      case 0:        Lcolor=Mcolor=Hcolor=O_color;      case 1:        Lcolor=L_color;        Mcolor=Hcolor=O_color;        break;      case 2:        Lcolor=Mcolor=M_color;        Hcolor=O_color;        break;      default:        Lcolor=Mcolor=Hcolor=H_color;      }  }  document.getElementById("strength_L").style.background=Lcolor;  document.getElementById("strength_M").style.background=Mcolor;  document.getElementById("strength_H").style.background=Hcolor;  return;}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.