I created a password using SHA1 as password encryption, where the password parameter is as follows:
$senha = sha1($_GET['senha']);
However, I'm not sure how to decrypt, even passing parameter, the sha1()
. I have the following example, which I have tried to put in the parameter and in the SQL statement, but it does not login:
<?php
$email =$_GET['email'];
$password = $_GET['password'];
$query="select * from usuario_app where (email = '$email') AND (sha1(senha) = '$password'))";
$result=$con->query($query);
if ($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
echo json_encode($row);
}
}
else
{
echo "error";
}
?>