Guest User

Untitled

a guest
Sep 12th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <?php
  2. include 'header.php';
  3. logged_in_redirect();
  4.  
  5. echo '<section>';
  6. echo '<fieldset style="width:735px;margin:0 auto;">';
  7. echo '<legend>Login</legend>';
  8.  
  9. if (empty($_POST) === false) {
  10. $username = $_POST['username'];
  11. $password = $_POST['password'];
  12.  
  13. if (empty($username) === true || empty($password) === true) {
  14. $errors[] = 'please enter a username or password.';
  15. } else if (user_exists($username) === false) {
  16. $errors[] = 'invalid username or password.';
  17. } else if (user_active($username) === false) {
  18. $errors[] = 'Your account is not currently active.';
  19. } else {
  20.  
  21.  
  22. if (strlen($password) > 32) {
  23. $errors[] = 'password to long';
  24. }
  25.  
  26. $login = login($username, $password);
  27. if($login === false) {
  28. $errors[] = 'that username/password combination is incorrect';
  29. } else {
  30. $_SESSION[`user_id`] = $login;
  31. header('location: index.php');
  32. exit();
  33. }
  34. }
  35. } else {
  36. $errors[] = 'No data recieved.';
  37.  
  38. }
  39. if (empty($errors) === false) {
  40. echo '<h2>We tried to log you in but ...</h2>';
  41. echo output_errors($errors);
  42. }
  43. ?>
  44. </fieldset>
  45. </section>
  46.  
  47. <footer>
  48. <div style="float:left;">
  49. WebDesign By: EMPIRIOUS
  50. </div>
  51. <div style="float:right;">
  52. Website and all of its contents are copyrighted to &copy; <a href="">RSbox.info</a>
  53. </div>
  54. </footer>
  55. </body>
  56.  
  57. </html>
Add Comment
Please, Sign In to add comment