Guest User

admin bypasss

a guest
Aug 20th, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors','0');
  3. ?>
  4.  
  5.  
  6.  
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <title>Untitled Document</title>
  12. </head>
  13.  
  14. <body>
  15. <div style="width:500px; height:300px; margin:auto">
  16. <div style="margin:auto">
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. <?php
  24. session_start();
  25. include("includes/application.php");
  26. //echo $_SESSION['email'];
  27. ?>
  28. <form method="post">
  29. <h1>Login</h1>
  30. <table>
  31. <tr>
  32. <td>Email:</td>
  33. <td><input type="text" name="email"></td>
  34. </tr>
  35. <tr>
  36. <td>Password:</td>
  37. <td><input type="password" name="password"></td>
  38. </tr>
  39. <tr>
  40. <td></td>
  41. <td><input type="submit" name="submit" value="Submit"></td></tr>
  42. </table>
  43. </form>
  44. <?php
  45. if(isset($_POST['submit']))
  46. {
  47. $email=$_POST['email'];
  48.  
  49. $password=$_POST['password'];
  50. $sql=mysql_query("select * from admin where email='$email' and password='$password' and status='1'");
  51. //echo "select * from admin where username='$username' and status='1'";
  52. $count=mysql_num_rows($sql);
  53. //echo $count;
  54. $row=mysql_fetch_array($sql);
  55. if($count==1)
  56. {
  57.  
  58. $_SESSION['email']=$email;
  59.  
  60. $_SESSION['auth']=$row;
  61.  
  62. //header('location:home.php');
  63. ?>
  64. <script>
  65. location.href = 'home.php';
  66. </script>
  67. <?php
  68.  
  69.  
  70.  
  71. }
  72. else
  73. {
  74. echo "invalid login credentials";
  75. }
  76. }
  77. ?>
  78. </div>
  79. </div>
  80.  
  81. </body>
  82. </html>
Add Comment
Please, Sign In to add comment