Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
—图例
判断字符串2次密码 字数不能超个6位,首字母必须为字母,输入二次密码不一致
-图例
—代码区
<?php
$pwd1=ucfirst($pwd1=$_GET["pwd1"]);
$pwd2=ucfirst($pwd2=$_GET["pwd2"]);
if (strlen($pwd1)>6||strlen($pwd2)>6){
echo '字数不能超过6位数';
}elseif(ord($pwd1)<65||ord($pwd1)>90||ord($pwd2)<65||ord($pwd2)>90){
echo '第一个字符串必须为字母';
}elseif($pwd1!==$pwd2){
echo '输入二次密码不一致';
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form action="" method="get">
输入密码:<input type="user1" name="pwd1"><br>
再次输入密码:<input type="user2" name="pwd2"><br>
<input type="submit">
</form>
</body>
</html>