Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- // database
- define('USERNAME', 'bob');
- define('PASSWORD', '123');
- if ($_SERVER['REQUEST_METHOD'] == 'POST')
- {
- if ($_POST['username'] == USERNAME && $_POST['password'] == PASSWORD)
- {
- $_SESSION['username'] = $_POST['username'];
- header('Location: admin.php');
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <h1>Login</h1>
- <form action="" method="post">
- <ul>
- <li>
- <label for="username">Username: </label>
- <input type="text" name="username">
- </li>
- <li>
- <label for="password">Password: </label>
- <input type="password" name="password">
- </li>
- <li>
- <input type="submit" value="Log in">
- </li>
- </ul>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement