Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start(); $username = $password = $userError = $ok = '';
- if(isset($_POST['sub'])){
- $username = $_POST['username']; $password = $_POST['password'];
- if($username === 'admin' && $password === 'admin')
- {
- $_SESSION['login'] = true;
- $ok = 'Dane OK';
- sleep(3);
- header('LOCATION:next.php');
- die();
- }
- if($username !== 'admin' && $username !== 'admin')$userError = 'Dane niepoprawne';
- }
- echo
- "<!DOCTYPE html>
- <html lang='pl'>
- <head>
- <meta charset=utf-8 />
- <title> Login System</title>
- <link rel='stylesheet' href='font-awesome/css/font-awesome.min.css'>
- <link href='https://fonts.googleapis.com/css?family=Orbitron|Sanchez|Space+Mono|VT323' rel='stylesheet'>
- </head>
- <body>
- <div class='form'>
- <!-- <img src='images/logo.png' class='logo'> -->
- <form name='input' action='{$_SERVER['PHP_SELF']}' method='post' id='login-main'>
- <div class='line-error'>
- <div class='error'>$userError</div>
- <div class='error'>$ok</div>
- </div>
- <div class='line'>
- <span class='label'>
- <label for='username'>User ID:</label>
- </span>
- <input type='text' value='$username' id='username' name='username' autocomplete='off'/>
- </div>
- <div class='line'>
- <span class='label'>
- <label for='password'>Password:</label>
- </span>
- <input type='password' value='$password' id='password' name='password' autocomplete='off'/>
- </div>
- <input type='submit' id='log-in' value='Zaloguj' name='sub' />
- </form>
- </div>
- </body>
- </html>"
- ;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement