Advertisement
Guest User

Untitled

a guest
Feb 7th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. if (mysqli_num_rows($resultado)>0) {
  2. $password = md5($password);
  3.  
  4. $sql = "SELECT * FROM user WHERE username = '$login' OR email = '$login'";
  5.  
  6. $resultado = mysqli_query($conexao,$sql);
  7.  
  8. if(!$resultado) {
  9. die('Not found');
  10. }
  11.  
  12. //$_SESSION['id_usuario'] = $dados['id'];
  13. if(mysqli_num_rows($resultado) == 1){
  14.  
  15. mysqli_close($conexao);
  16. $dados = mysqli_fetch_array($resultado);
  17. $_SESSION['logado'] = true;
  18.  
  19. $_SESSION['id_usuario'] = $dados['id'];
  20. echo "<div class='alert alert-success' role='alert'>Login e senha confirmado</div>";
  21. header('location:../../../index.php');
  22.  
  23.  
  24. }else{
  25. $erros[] = "<div class='alert alert-danger' role='alert'>Usuario Inexistente</div>";
  26.  
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement