Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include("config.php");
- /*
- if($_SESSION['certificate_authed'] == 0) {
- header("location: index.php");
- }
- */
- if(isset($_POST['submit'])) {
- echo "
- <script type='text/javascript'>
- function beans() {
- new Effect.Appear('response2');
- document.getElementById('message2').innerHTML = \"<img src=\"images/accept.png\"> <b><u>Logging in!</u></b><br>Please wait a couple of seconds while we finalize the process.<br />\";
- }</script>";
- $username = mysql_real_escape_string($_POST['username']);
- $password = hash( 'whirlpool', $_POST['password'] );
- if(empty($username) || empty($password)) {
- echo " You have missed out a box, please retry and fill it in.";
- } else {
- $isreal = mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `Name`='" . $username . "' AND `Password`='" . $password . "'"));
- $select = mysql_query("SELECT * FROM `users` WHERE `Name`='".$username."'");
- $select2 = mysql_fetch_array($select);
- $level = $select2['AdminLevel'];
- if($isreal == 0) {
- echo "There are no users with those login details.";
- } else {
- // 2
- $_SESSION['logged_in'] = 1;
- $_SESSION['certificate_authed'] = 1;
- $_SESSION['username'] = $username;
- echo("<meta http-equiv='refresh' content='0;url=index.php'>");
- }
- }
- }
- ?>
- <html>
- <head>
- <title>Welcome To APCnR Housekeeping</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link href="css/index.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="javascript/prototype.js"></script>
- <script type="text/javascript" src="javascript/scriptaculous.js"></script>
- <script type="text/javascript" src="javascript/index.js"></script>
- <style type="text/css">
- body,td,th {
- font-size: 12px;
- }
- </style>
- </head>
- <div id="box">
- <center>
- <span class="header">Login to Housekeeping V2</span>
- </center>
- <br>
- <div id="response" style="display: none;"><span id="message"></span></div>
- <div id="response2" style="display: none;"><span id="message2"></span></div>
- <br>
- <div id="login2">
- <form method="post" name="login">
- <table summary="login form">
- <tr>
- <td><b>Username</b></td>
- <td><input type="text" name="username" class="formss"></td>
- </tr>
- <tr>
- <td><b>Password</b></td>
- <td><input type="password" name="password" class="formss"></td>
- </tr>
- <tr>
- <td></td>
- <td><input name="submit" type="submit" class="formsss" onSubmit="return beans();" value="Log in"/></td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- <center>
- </center>
- </body>
- </html>
- <?php
- ?>
Add Comment
Please, Sign In to add comment