I'm trying to login through PHP using a usernames and passwords from a MySQL database that saves userID, usernames, and hashed_passwords (that I created earlier using a registration form, and the salt for the md5 hash is: 2155).
The problem is I'm not able to get the password to be unencrypted to use it for the login.
And I'm not sure if this is how to code the query to look for username and password from the database based on the user input.
$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");
}