Advertisement
alantccgti

Untitled

Oct 17th, 2019
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2. ini_set("display_errors",1);
  3.  
  4. if($_SERVER['REQUEST_METHOD'] == 'POST') {
  5. $nc = mysqli_connect('localhost','root','1111');
  6. mysqli_select_db($nc,'injection');
  7.  
  8. $usuario = $_POST['usuario'];
  9. $senha = $_POST['senha'];
  10. $sql = "SELECT * FROM login WHERE usuario = '$usuario' AND senha='$senha'";
  11. $query = mysqli_query($nc, $sql);
  12.  
  13. if(mysqli_num_rows($query)==1)
  14. {
  15.     header("location:admin.php");
  16. }
  17.  
  18. else
  19. {
  20.     echo "Usuário ou senha inválidos";
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement