4-30用户注册界面

选择题

1-5 C ABD D C A
6-10 C D B C A
11-15 A B ACD D A
16-20 B A D C B
21-23 D B A

用户注册界面

  1. <h1>用户注册</h1>
  2. <form action="doem.php" method="post">
  3. <p>用户名</p>
  4. <input type="text" name="userName" id="userName" placeholder="UserName"/>
  5. <span class="cuo">用户名首位需是字母</span>
  6. <p>密码</p>
  7. <input type="password" name="password" id="password" placeholder="password"/>
  8. <span class="cuo">密码由6-16的字母、数字、符号组成</span>
  9. <p>确认密码</p>
  10. <input type="password" name="repassword" id="repassword" placeholder="确认密码"/>
  11. <span class="cuo">密码要一致</span>
  12. <p class="psw-p1">验证</p>
  13. <input type="text" name="uPsw" placeholder="请输入验证码" />
  14. <span><button>获取验证码</button></span>
  15. <p class="psw-p1">确认验证码</p>
  16. <input type="text" name="reuPsw" placeholder="请确认验证码" />
  17. <div>
  18. <button style="color:red;border-style:none;background-color:skyblue">立即注册</button>
  19. </div>
  20. </form>
  1. //通过全局成员$_POST获取以上的用户名,密码和验证码
  2. $userName=$_POST['userName'];
  3. $password=$_POST['password'];
  4. $repassword=$_POST['repassword'];
  5. $uPsw=$_POST['uPsw'];
  6. $reuPsw=$_POST['$reuPsw'];
  7. if(!ucfirst($userName)){
  8. echo '<script>alert("用户名首位需是字母而且是大写");</script>';
  9. }
  10. if(strlen($password)!=strlen($repassword)
  11. && strcmp('$password','$repassword')!==0){
  12. echo '<script>alert("密码与确认密码应该一致");</script>';
  13. }
  14. if(strcasecmp('$uPsw','$reuPsw')==0){
  15. echo '<script>alert("验证码正确");</script>';
  16. }
  17. else{
  18. echo '<script>alert("验证码前后不正确");</script>';
  19. }