Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $output = 0;
- if(!isset($_SESSION["username"]) and !isset($_GET["page"])) {
- $output = 0;
- }
- if($_GET["page"] == "log") {
- $user = $_POST["user"];
- $password = $_POST["password"];
- if($user == "Admin" and $password == "test") {
- $_SESSION["username"] = $user;
- $output = 1;
- } else {
- $output = 2;
- }
- }
- ?>
- <html>
- <head>
- <meta name='viewport' content='width=device-width, initial-scale=1>
- <meta charset="utf-8">
- <title>Login</title>
- <?php
- if($output == 1) {
- ?>
- <meta http-equiv="refresh" content="3; URL=hash.php" />
- <?php
- }
- ?>
- </head>
- <body>
- <?php
- if ($output == 0) {
- ?>
- Bitte logge dich ein: <br>
- <form method="post" action="index.php?page=log">
- Username: <input type="text" name="user" /> <br>
- Passwort: <input type="password" name="Password" /> <br>
- <input type="submit" value="Einloggen" /> <br>
- <?php
- }
- if($ouput == 1) {
- ?>
- Login erfolgreich! Du wirst sofort weiter geleitet.
- <?php
- }
- if(output == 2) {
- ?>
- Passwort oder Username falsch, bitte probier es nochmal! <br>
- <a href='index.php'>Zurück </a>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement