php实验3.4
<?php
$name="";
$pass="";
$repass="";
if(!empty($_POST)){
$name=$_POST["name"];
$pass=$_POST["password"];
$repass=$_POST["repassword"];
if($name==""){
echo "<script>alert('用户名不为空!')</script>";
}
if($pass!=$repass){
echo "<script>alert('两次密码必须一致!')</script>";
}
if(($name!=="")&&($pass==$repass)){
echo "<script>location.href='3.php'</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div align="center">
<strong>用户注册</strong>
<form action="" method="post">
用户名:<input type="text" name="name" id="name"/><br/>
密码:<input type="password" name="password" id="password"/><br/>
确认密码:<input type="password" name="repassword" id="repassword"/><br/>
<input type="submit" value="提交"/>
<input type="reset" value="重置"/>
</form>
</div>
</body>
</html>