我正在尝试使用 MySQL 数据库中的用户名和密码通过 PHP 登录,该数据库保存用户 ID、用户名和 hashed_passwords(我之前使用注册表创建,md5 哈希的盐是:2155)。
问题是我无法获取未加密的密码以将其用于登录。
而且我不确定这是否是如何编码查询以根据用户输入从数据库中查找用户名和密码。
$sql = "SELECT * FROM user where username = '$_POST["username"]' AND password = '$_POST["password"]";
$rows = $conn->query($sql);
if ($userID > 0){
echo "Hello World";
header("Location: login_success.php");
}
else{
echo "Unsuccessful";
header("Location: index.php");
}