Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(isset($_SESSION['login'])){
- header("Location: Stranka.php");
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="Loginstyle.css">
- <title>Administrace</title>
- </head>
- <body>
- <div id="Login">
- <div class="logintext">
- <form method="POST">
- <label for="name"><font size="5.5" color="white"><b>Jméno: </b></font></label>
- <input type="text" name="name" placeholder="username">
- <br>
- <label for="pass"><font size="5.5" color="white"><b>Heslo: </b></font></label>
- <input type="password" name="pass" placeholder="password">
- <input type="submit" name="check" value="Přihlásit se">
- </form>
- </div>
- </div>
- <?php
- $password = 'mysqlerror404';
- $username1 = 'root';
- $usernamefake = 'admin';
- $passwordfake = 'admin1234';
- if (isset($_POST['check'])) {
- $username = htmlspecialchars($_POST['name']);
- if ($_POST['name'] == $username1 && $_POST['pass'] == $password) {
- $_SESSION['login'] = "root";
- header("Location: Stranka.php");
- die();
- } else if ($_POST['name'] == $usernamefake && $_POST['pass'] == $passwordfake) {
- $_SESSION['login'] = "admin";
- header("Location: http://google.com");
- die();
- } else {
- echo "<b><center><font color='white'>Chybné uživatelské jméno nebo heslo !</font></center></b>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement