Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ob_start();
  4. include '../_inc/loader.php';
  5. ?>
  6.  
  7. <html>
  8. <head>
  9. <title>PersonalCMS - Administration</title>
  10.  
  11. <meta http-equiv="X-UA-Compatible" content="IE=9" />
  12.  
  13. <link href="_style/style.css" rel="stylesheet" type="text/css">
  14.  
  15. </head>
  16. </html>
  17.  
  18. <?php
  19. if($user->loggedIn()) {
  20. echo header("Location: _dashboard/index.php");
  21. } else {
  22. if(isset($_POST['username']) || isset($_POST['password'])) {
  23. $username = $security->data($_POST['username']);
  24. $password = $security->encrypt($_POST['password']);
  25. $user1 = $db->query("SELECT * FROM `users` WHERE `username` = '{$username}' && `password` = '{$password}'");
  26. $usernum = $db->num($user1);
  27. if($usernum == 0) {
  28. ?>
  29. <html>
  30. <body>
  31. <div id="login_box">
  32. <div id="inner_login_box">
  33. <br /><br />
  34. <img src="_style/images/wrong_logo.png" />
  35. <br /><br />
  36. <form action="login.php" method="post">
  37. <input type="text" name="username" id="username" value="Username" class="text_field" onclick="this.value = ''"/>
  38. <input type="password" name="password" id="password" value="Password" class="text_field" onclick="this.value = ''"/>
  39. <input type="submit" value="Login" class="text_button" />
  40. </form>
  41. </div>
  42. </div>
  43. <br /><br />
  44. <div class="red_text">
  45. Incorrect information! Please try again!
  46. </div>
  47. </body>
  48. </html>
  49. <?php
  50. } else {
  51. $_SESSION['username'] = $username;
  52. $_SESSION['password'] = $password;
  53. header("Location: _dashboard");
  54. }
  55. }
  56. elseif(empty($_POST['username']) || empty($_POST['password'])) {
  57. ?>
  58. <html>
  59. <body>
  60. <div id="login_box">
  61. <div id="inner_login_box">
  62. <br /><br />
  63. <img src="_style/images/wrong_logo.png" />
  64. <br /><br />
  65. <form action="login.php" method="post">
  66. <input type="text" name="username" id="username" value="Username" class="text_field" onclick="this.value = ''"/>
  67. <input type="password" name="password" id="password" value="Password" class="text_field" onclick="this.value = ''"/>
  68. <input type="submit" value="Login" class="text_button" />
  69. </form>
  70. </div>
  71. </div>
  72. <div class="red_text">
  73. Field left blank! Please try again!
  74. </div>
  75. </body>
  76. </html>
  77. <?php
  78. }
  79. ?>
  80. <html>
  81. <body>
  82. <div id="login_box">
  83. <div id="inner_login_box">
  84. <br /><br />
  85. <img src="_style/images/logo.png" />
  86. <br /><br />
  87. <form action="login.php" method="post">
  88. <input type="text" name="username" id="username" value="Username" class="text_field" onclick="this.value = ''"/>
  89. <input type="password" name="password" id="password" value="Password" class="text_field" onclick="this.value = ''"/>
  90. <input type="submit" value="Login" class="text_button" />
  91. </form>
  92. </div>
  93. </div>
  94. </body>
  95. </html>
  96. <?php
  97. }
  98. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement