非常感谢您的帮助!出于某种原因,在表单字段中输入了密码:
<div>Confirm Password</div>
<input id="password2" name="password2" type="password" maxlength="100">
当将其作为POST变量获取时,没有在下面的php代码中注册:
$p2 = $_POST['password2'];
上面的php代码在html表单之上,如果这很重要的话。。。表单发布到update.php,这是这两段代码所在的文件名。
应该是这样的
<form action="somewhere.php" method="post">
<input id="password2" name="password2" type="password" maxlength="100">
<input type="submit" name="submit">
</form>
在somewhere.php上,您可以查看
if(isset($_POST['submit'])){
$p2 = $_POST['password2'];
}else{echo "sorry form not submitted";}