Advertisement
Guest User

bakla ka justin

a guest
May 14th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 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.  
  29.  
  30.  
  31.  
  32. <?php
  33. include 'database.php';
  34. if(isset($_POST['enter']))
  35. {
  36. $username=$_POST['username'];
  37. $password=$_POST['password'];
  38. {
  39.  
  40. $pdo = Database::connect();
  41. $sql = "SELECT * FROM admin";
  42. foreach ($pdo->query($sql) as $row)
  43.  
  44.  
  45. '<tr>';
  46.  
  47.  
  48. '<td>'. $row['id'] . '</td>';
  49. '<td>'. $row['username'] . '</td>';
  50. '<td>'. $row['password'] . '</td>';
  51. // echo '<td>'. $row['link'] . '</td>';
  52.  
  53. '</tr>';
  54. /*$count = mysql_num_rows($row);
  55.  
  56. }
  57. if ($count == 0)
  58. {
  59. echo "<script>alert('Please check your username and password!'); window.location='login.php'</script>";
  60. }
  61. else if ($count > 0)
  62. {
  63. session_start();
  64. $_SESSION['id'] = $row['id'];
  65. header("location:index.php");
  66. }
  67. }*/
  68. }
  69. if ($username == $row['username'] && $password == $row['password'])
  70. {
  71. session_start();
  72. $_SESSION['id'] = $row['id'];
  73. header("location:index.php");
  74. }
  75. else{
  76. echo "<script>alert('Please check your username and password!'); window.location='login.php'</script>";
  77.  
  78. }
  79. }
  80.  
  81.  
  82.  
  83.  
  84. Database::disconnect();
  85. ?>
  86.  
  87. </div>
  88.  
  89. </div>
  90.  
  91. </body>
  92.  
  93. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement