Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- echo isset($_SESSION['login']);
- if(isset($_SESSION['login'])) {
- header('LOCATION:1.php'); die();
- }
- ?>
- <html>
- <head>
- <meta http-equiv='content-type' content='text/html;charset=utf-8' />
- <title>Login</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <ul class="topnav">
- <li class="center"><h1>Lajna</h1></li>
- </ul>
- <p>
- <div class="container">
- <?php
- if(isset($_POST['submit'])){
- $password = $_POST['password'];
- if($password === 'michal1598'){
- $_SESSION['login'] = true; header('LOCATION:1.php'); die();
- } {
- echo "<div class='alert alert-danger'>Heslo není správné!</div>";
- }
- }
- ?>
- <form action="" method="post">
- <div class="form-group">
- <label for="pwd">Password:</label>
- <input type="password" class="form-control" id="pwd" name="password" required>
- </div>
- <button type="submit" name="submit" class="button-login">Login</button>
- </form>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment