Blogger Information
Blog 28
fans 0
comment 0
visits 15755
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0809 字符串查找和编码字符串
︷肉園耔︷
Original
659 people have browsed it

—图例
判断字符串2次密码 字数不能超个6位,首字母必须为字母,输入二次密码不一致
-图例

—代码区

  1. <?php
  2. $pwd1=ucfirst($pwd1=$_GET["pwd1"]);
  3. $pwd2=ucfirst($pwd2=$_GET["pwd2"]);
  4. if (strlen($pwd1)>6||strlen($pwd2)>6){
  5. echo '字数不能超过6位数';
  6. }elseif(ord($pwd1)<65||ord($pwd1)>90||ord($pwd2)<65||ord($pwd2)>90){
  7. echo '第一个字符串必须为字母';
  8. }elseif($pwd1!==$pwd2){
  9. echo '输入二次密码不一致';
  10. }
  11. ?>
  12. <!doctype html>
  13. <html lang="en">
  14. <head>
  15. <meta charset="UTF-8">
  16. <meta name="viewport"
  17. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  18. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  19. <title>Document</title>
  20. </head>
  21. <body>
  22. <form action="" method="get">
  23. 输入密码:<input type="user1" name="pwd1"><br>
  24. 再次输入密码:<input type="user2" name="pwd2"><br>
  25. <input type="submit">
  26. </form>
  27. </body>
  28. </html>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post