Guest User

Untitled

a guest
Feb 4th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $_SESSION['log']=false;
  4. ?>
  5.  
  6. <br>
  7. Zaloguj sie aby przejsc dalej
  8.  
  9. <form action="" method="POST">
  10. <b>Podaj login:</b> <input type="text" name="login">
  11. <br/>
  12. <b>Podaj hasło:</b> <input type="password" name="haslo">
  13. <br/>
  14. <input type="submit" name="ok" value="Zaloguj sie!">
  15. </form>
  16.  
  17. <?php
  18. if (isset($_GET['logout']))
  19. {
  20.     $_SESSION['log'] = false;
  21. }
  22.  
  23. if (isset($_POST['ok']))
  24. {
  25.         if ($_POST['login'] == 'uzytkownik' && $_POST['haslo'] == 'haslo')
  26.         {
  27.             $_SESSION['log']=true;
  28.             header("Location: admin.php");
  29.         }
  30.         if ($_POST['login'] !=  'uzytkownik' || $_POST['haslo'] != 'haslo')
  31.         {
  32.             echo "Nieudane logowanie";
  33.         }
  34. }
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment