Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2.  
  3. include_once 'index8.php';
  4.  
  5. $connect = new mysqli ($host, $dbuser, $dbpass, $dbname);
  6.  
  7. if ($connect->connect_errno!=0) {
  8. echo "BŁĄD " . $connect_errno();
  9. }
  10. else
  11. {
  12. $login = $_POST['login'];
  13. $password = $_POST['pass'];
  14.  
  15. $sql = "SELECT * FROM users WHERE uzytkownik='$login' AND haslo='$password'";
  16. if($rezultat = $connect->query($sql)) {
  17. $ilu_uzytkownikow = $rezultat->num_rows;
  18. if ($ilu_uzytkownikow>0){
  19. $wiersz = $rezultat->fetch_assoc();
  20. $user = $wiersz['login'];
  21.  
  22.  
  23. header('Location: mainpage.php');
  24. }
  25. }
  26. $connect->close();
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement