Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'header.php';
- logged_in_redirect();
- echo '<section>';
- echo '<fieldset style="width:735px;margin:0 auto;">';
- echo '<legend>Login</legend>';
- if (empty($_POST) === false) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- if (empty($username) === true || empty($password) === true) {
- $errors[] = 'please enter a username or password.';
- } else if (user_exists($username) === false) {
- $errors[] = 'invalid username or password.';
- } else if (user_active($username) === false) {
- $errors[] = 'Your account is not currently active.';
- } else {
- if (strlen($password) > 32) {
- $errors[] = 'password to long';
- }
- $login = login($username, $password);
- if($login === false) {
- $errors[] = 'that username/password combination is incorrect';
- } else {
- $_SESSION[`user_id`] = $login;
- header('location: index.php');
- exit();
- }
- }
- } else {
- $errors[] = 'No data recieved.';
- }
- if (empty($errors) === false) {
- echo '<h2>We tried to log you in but ...</h2>';
- echo output_errors($errors);
- }
- ?>
- </fieldset>
- </section>
- <footer>
- <div style="float:left;">
- WebDesign By: EMPIRIOUS
- </div>
- <div style="float:right;">
- Website and all of its contents are copyrighted to © <a href="">RSbox.info</a>
- </div>
- </footer>
- </body>
- </html>
Add Comment
Please, Sign In to add comment