Advertisement
Guest User

Untitled

a guest
Sep 17th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. require 'connect.php';
  3.  
  4.  
  5.  
  6. $pesel = addslashes($_POST['pesel']);
  7. $password = addslashes($_POST['password']);
  8.  
  9. $sql = "SELECT * FROM passwords WHERE id_user='".$pesel."' AND password='".$password."'";
  10.  
  11.  
  12.  
  13.  
  14. $result = $conn->query($sql);
  15. if ($result->num_rows > 0) {
  16. // tutaj kod na rozpoczęcie sesji
  17. session_start();
  18. $sql2 = "DELETE FROM passwords WHERE id_user='".$_POST['pesel']."'";
  19. $result = $conn->query($sql2);
  20. $_SESSION["zalogowany"]=1;
  21. header('Location: Glosowanie/home.php');
  22.  
  23.  
  24.  
  25.  
  26. }
  27. else {
  28. echo "Błąd";
  29. }
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement