MichalCzEJ

Untitled

Dec 5th, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <?php
  2. session_start();
  3. echo isset($_SESSION['login']);
  4. if(isset($_SESSION['login'])) {
  5. header('LOCATION:1.php'); die();
  6. }
  7. ?>
  8. <html>
  9. <head>
  10. <meta http-equiv='content-type' content='text/html;charset=utf-8' />
  11. <title>Login</title>
  12. <meta charset="utf-8">
  13. <meta name="viewport" content="width=device-width, initial-scale=1">
  14. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  15. <link rel="stylesheet" type="text/css" href="style.css">
  16. </head>
  17. <body>
  18. <ul class="topnav">
  19. <li class="center"><h1>Lajna</h1></li>
  20. </ul>
  21. <p>
  22. <div class="container">
  23.  
  24. <?php
  25. if(isset($_POST['submit'])){
  26. $password = $_POST['password'];
  27. if($password === 'michal1598'){
  28. $_SESSION['login'] = true; header('LOCATION:1.php'); die();
  29. } {
  30. echo "<div class='alert alert-danger'>Heslo není správné!</div>";
  31. }
  32.  
  33. }
  34. ?>
  35. <form action="" method="post">
  36. <div class="form-group">
  37. <label for="pwd">Password:</label>
  38. <input type="password" class="form-control" id="pwd" name="password" required>
  39. </div>
  40. <button type="submit" name="submit" class="button-login">Login</button>
  41. </form>
  42. </div>
  43. </body>
  44. </html>
Add Comment
Please, Sign In to add comment