Guest User

Untitled

a guest
Dec 5th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. session_start();
  5. include("config.php");
  6.  
  7. /*
  8. if($_SESSION['certificate_authed'] == 0) {
  9.  
  10. header("location: index.php");
  11.  
  12. }
  13. */
  14.  
  15. if(isset($_POST['submit'])) {
  16.  
  17. echo "
  18. <script type='text/javascript'>
  19. function beans() {
  20. new Effect.Appear('response2');
  21. document.getElementById('message2').innerHTML = \"<img src=\"images/accept.png\">&nbsp;<b><u>Logging in!</u></b><br>Please wait a couple of seconds while we finalize the process.<br />\";
  22. }</script>";
  23.  
  24. $username = mysql_real_escape_string($_POST['username']);
  25. $password = hash( 'whirlpool', $_POST['password'] );
  26.  
  27. if(empty($username) || empty($password)) {
  28. echo " You have missed out a box, please retry and fill it in.";
  29.  
  30. } else {
  31.  
  32. $isreal = mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `Name`='" . $username . "' AND `Password`='" . $password . "'"));
  33. $select = mysql_query("SELECT * FROM `users` WHERE `Name`='".$username."'");
  34. $select2 = mysql_fetch_array($select);
  35. $level = $select2['AdminLevel'];
  36.  
  37. if($isreal == 0) {
  38. echo "There are no users with those login details.";
  39.  
  40. } else {
  41.  
  42. // 2
  43. $_SESSION['logged_in'] = 1;
  44. $_SESSION['certificate_authed'] = 1;
  45. $_SESSION['username'] = $username;
  46.  
  47. echo("<meta http-equiv='refresh' content='0;url=index.php'>");
  48. }
  49.  
  50. }
  51.  
  52. }
  53. ?>
  54.  
  55. <html>
  56. <head>
  57. <title>Welcome To APCnR Housekeeping</title>
  58. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  59. <link href="css/index.css" rel="stylesheet" type="text/css" />
  60. <script type="text/javascript" src="javascript/prototype.js"></script>
  61. <script type="text/javascript" src="javascript/scriptaculous.js"></script>
  62. <script type="text/javascript" src="javascript/index.js"></script>
  63. <style type="text/css">
  64. body,td,th {
  65. font-size: 12px;
  66. }
  67. </style>
  68.  
  69. </head>
  70. <div id="box">
  71. <center>
  72. <span class="header">Login to Housekeeping V2</span>
  73. </center>
  74. <br>
  75. <div id="response" style="display: none;"><span id="message"></span></div>
  76. <div id="response2" style="display: none;"><span id="message2"></span></div>
  77. <br>
  78. <div id="login2">
  79. <form method="post" name="login">
  80. <table summary="login form">
  81. <tr>
  82. <td><b>Username</b></td>
  83. <td><input type="text" name="username" class="formss"></td>
  84. </tr>
  85. <tr>
  86. <td><b>Password</b></td>
  87. <td><input type="password" name="password" class="formss"></td>
  88. </tr>
  89. <tr>
  90. <td></td>
  91. <td><input name="submit" type="submit" class="formsss" onSubmit="return beans();" value="Log in"/></td>
  92. </tr>
  93. </table>
  94. </form>
  95. </div>
  96. </div>
  97. <center>
  98. </center>
  99. </body>
  100. </html>
  101.  
  102.  
  103. <?php
  104.  
  105.  
  106. ?>
Add Comment
Please, Sign In to add comment