<?php
class Login{
public function logar($email,$senha){
$connect=new DB;
$connect=$connect->conectar();
$sql="select * from usuarios where email='$email' and senha='$senha' and status='1' limit 1;";
$buscar=mysqli_query($connect,$sql);
$result=mysqli_num_rows($buscar);
if ($result==1) {
$log=1;
$dados=mysqli_fetch_array($buscar);
$_SESSION["email"]=$dados["email"];
$_SESSION["senha"]=$dados["senha"];
$_SESSION["nivel"]=$dados["nivel"];
setcookie("logado",1);
}
if (isset($log)) {
$flash="Logado com sucesso!";
}else{
$flash="Verifique se as informações inseridas estão corretas!";
}
echo $flash;
}
}
?>
Does this above code exist that makes it impossible for the query to be other than '1'? We assume the following situation: in my database there is an email record:'[email protected] 'and password:' admin ' so when running this code by entering the correct information the response shown on the screen is "Verify that the information entered is correct!"?