Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (isset($_POST['username']))
- {
- if ( $_POST['username'] == 'inte' &&
- $_POST['password'] == '2047')
- {
- $_SESSION['logged_in'] = 'true';
- }
- else
- {
- echo '
- <i>Incorrect login details.
- please try again</i><br />';
- }
- }
- if (! (isset($_SESSION['logged_in']) &&
- $_SESSION['logged_in'] == 'true') )
- {
- echo '
- <html>
- <head>
- <title>Login form</title>
- </head>
- <body>
- <form action="' . $_SERVER['PHP_SELF'] . '"
- method="POST">
- <div id="logincontainer">
- <div id="usernamelogin">
- Username: <input type="text"
- name="username" />
- </div>
- <br />
- <div id="usernamepassword"/>
- Password: <input type="password"
- name="password" />
- </div>
- <br />
- <input type="submit" value="Login" />
- </div>
- </form>
- </body>
- </html>
- ';
- exit;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement