Advertisement
Guest User

Untitled

a guest
Nov 30th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if (!isset($_SESSION['zalogowany'])){
  4. $login = $_POST['user'];
  5. $pass = $_POST['password'];
  6. require("../lib/connect.php");
  7. $sql = "SELECT * FROM users where user='$login' and pass='$pass'";
  8. $result = $conn->query($sql);
  9. $res_num = $result->num_rows;
  10. if ($res_num==1) {
  11. $_SESSION['zalogowany'] = 1;
  12. $_SESSION['login'] = $login;
  13. header('location:index.php');
  14. }else{
  15. echo"Zly login lub haslo";
  16. echo"<br><a href='index.php'>Zaloguj sie jeszcze raz</a>";
  17. }
  18. }else{
  19. header('location:index.php');
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement