Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2. if (isset($_POST["entrar_botao"])) {
  3. $user = $_POST["input_user"];
  4. $pass = $_POST["input_pass"];
  5. //faz a seleção dos dados
  6. $checar = $pdo->prepare("SELECT * FROM usuarios WHERE Usuario = :usuario AND Senha = :senha");
  7. $checar->bindValue(":usuario",$user);
  8. $checar->bindValue(":senha",$pass);
  9. $checar->execute();
  10. //verifica se o usuário está correto
  11. $selecao = $checar->rowCount();
  12. if ($selecao > 0) {
  13. header("Location:administrador.php");
  14.  
  15. }else{
  16. echo "<script>alert('Usuário ou senha incorretos!');</script>";
  17. }
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement