Guest User

Untitled

a guest
May 2nd, 2018
118
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. ob_start();
  3. $user = $_POST['un'];
  4. $pass = $_POST['pw'];
  5.  
  6. $unpws = file("rest_data/eta_un_pw.txt");
  7.  
  8. $allowLogin = false;
  9.  
  10. for($i = 0; $i<count($unpws); $i++)
  11. {
  12. $tempArray = explode(":",$unpws[$i]);
  13. if($tempArray[0] == $user && $tempArray[1] == $pass)
  14. {
  15.  
  16. $allowLogin = true;
  17. }
  18. else
  19. {
  20. $allowLogin = false;
  21. }
  22. }
  23.  
  24. if($allowLogin == true)
  25. {
  26. session_start();
  27. $_SESSION['user'] = $user;
  28. ob_flush();
  29. header("Location: etaCreator.php");
  30. }
  31. else
  32. {
  33. echo "Sorry. Your username and password did not match.";
  34. }
  35. ?>
Add Comment
Please, Sign In to add comment