Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Admin Login</title>
- <link href="styleforlogin.css"rel="stylesheet" type="text/css">
- </head>
- <body>
- <div class="container">
- <img src ="logo.png">
- <form action="account.php" method="post">
- <div class="form-input">
- <input type="text" name="username" placeholder="Enter Username">
- </div>
- <div>
- <input type="password" name="password" id="txtPassword" placeholder="Enter Password">
- <tr>
- <td>
- <label for="chkShowPassword">
- <h5><input type="checkbox" id="chkShowPassword"/>
- Show password</h5></label>
- </td>
- </tr>
- <input type="submit" name="submit" value="LOG IN" class="btn-login">
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
- <script type="text/javascript">
- $(function () {
- $("#chkShowPassword").bind("click", function () {
- var txtPassword = $("#txtPassword");
- if ($(this).is(":checked")) {
- txtPassword.after('<input onchange = "PasswordChanged(this);" id = "txt_' + txtPassword.attr("id") + '" type = "text" value = "' + txtPassword.val() + '" />');
- txtPassword.hide();
- } else {
- txtPassword.val(txtPassword.next().val());
- txtPassword.next().remove();
- txtPassword.show();
- }
- });
- });
- function PasswordChanged(txt) {
- $(txt).prev().val($(txt).val());
- }
- </script>
- </center></form></div>
- <?php
- if (isset($_POST['submit']))
- {
- include('adminconnect.php');
- $un = $_POST['username'];
- $p = $_POST['password'];
- if(!empty($_POST['username']) || !empty($_POST['password']))
- {
- $query = "SELECT admin_id, first_name, last_name FROM tb_admin WHERE username='$un' AND password='$p'";
- $result = @mysql_query($query);
- $row = mysql_fetch_array($result,MYSQL_NUM);
- if ($row)
- {
- echo "<script>alert('Redirecting to home page')</script>";
- {
- header('location:loginhome2.php');
- }
- exit();
- }
- else
- {
- echo '<br><center><mark>The username and password entered do not match.</center></mark>';
- }
- }
- else
- echo '<br><center><mark>Please enter username and/or password.</center></mark>';
- mysql_close();
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement