Advertisement
Guest User

taena mo justin

a guest
May 14th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>TK Juicy Dawgs - Admin</title>
  5. <link href="css/index.css" rel="stylesheet" type="text/css" />
  6.  
  7.  
  8. </head>
  9.  
  10. <body>
  11.  
  12. <div id="wrapper">
  13.  
  14. <div id="login_form">
  15. <b>TK Juicy Dawgs</b>
  16. <br />
  17. <br />
  18. <form method="post" >
  19. <input type="text" name="username" class="txt_box" title="USERNAME" placeholder="Username" required />
  20. <br />
  21. <br />
  22. <input type="password" name="password" class="txt_box" title="PASSWORD" placeholder="Password" required>
  23. <br />
  24. <br />
  25. <button name="enter" value="Login" title="LOGIN" class="login_button">Login</button>
  26. </form>
  27.  
  28. <?php
  29. include('database.php');
  30.  
  31. if(isset($_POST['enter']))
  32. {
  33. $username=$_POST['username'];
  34. $password=$_POST['password'];
  35. {
  36. $result = mysql_query("SELECT * FROM admin WHERE username = '$username' and password='$password'");
  37. or die(mysql_error($connection));
  38.  
  39. $row = mysqli_fetch_array($result);
  40. $count = mysqli_num_rows($result);
  41. if ($count == 0)
  42. {
  43. echo "<script>alert('Please check your username and password!'); window.location='login.php'</script>";
  44. }
  45. else if ($count > 0)
  46. {
  47. session_start();
  48. $_SESSION['id'] = $row['id'];
  49. header("location:index.php");
  50. }
  51. }
  52. }
  53. ?>
  54.  
  55. </div>
  56.  
  57. </div>
  58.  
  59. </body>
  60.  
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement