我目前正在基准级别重置忘记密码。下面的代码似乎在显示任何错误消息或甚至用新密码更新数据库方面起作用。请帮忙。
<?php
if(isset($message) AND $message !=''){
echo '<p style="color:#c43235">'.$message.'</p>';
}else {
echo '<span id="alrt">'.$sent.'</span>';
}
mysqli_close($dbc);
?>
//错误显示代码
{{1}}
答案 0 :(得分:0)
您使用$post_email = $_POST['email'];
所以你的查询
而不是
$q = "UPDATE users SET password='$passrst' AND passreset='0' WHERE email='$email'";
应该是
$q = "UPDATE users SET password='$passrst' AND passreset='0' WHERE email=' $post_email'";
答案 1 :(得分:0)
更改
} else "something went wrong please try again.";
到
} else $message = "something went wrong please try again.";