I need to create a login system for an application that will work off the site and I need it to connect to the standard WordPress database but the passwords in the database are protected by Hash.
I would like to know if you can cancel the Hash encoding or if there is any php script that can get the user's original password without being decoded by Hash.
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully.<br>";
$sql = "SELECT user_pass FROM testeUsers WHERE user_email = '".$loginUser . "'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
if($row["user_pass"]== $loginPass){
echo "Login Sucess";
//colocar as funções aqui
}
else{
echo "wrong password";
}
}
} else {
echo "User not found";
}
The problem is that this PHP code takes the text that is written in the user_pass field in the database and that user_pass is not the user's real password because it is in Hash, so my user will never be able to log into the system even his password being correct.