Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. <?php
  2. include("config.php");
  3. session_start();
  4.  
  5. if($_SERVER["REQUEST_METHOD"] == "POST") {
  6. // username and password sent from form
  7.  
  8. $myusername = mysqli_real_escape_string($db,$_POST['username']);
  9. $mypassword = mysqli_real_escape_string($db,$_POST['password']);
  10.  
  11. $sql = "SELECT id FROM admin WHERE username = '$myusername' and passcode = '$mypassword'";
  12. $result = mysqli_query($db,$sql);
  13. $row = mysqli_fetch_array($result,MYSQLI_ASSOC);
  14. $active = $row['active'];
  15.  
  16. $count = mysqli_num_rows($result);
  17.  
  18. // If result matched $myusername and $mypassword, table row must be 1 row
  19.  
  20. if($count == 1) {
  21. $_SESSION['variable']=("myusername");
  22. $_SESSION['login_user'] = $myusername;
  23.  
  24. header("Location: scratch.php");
  25. }else {
  26. $error = "Andas a tentar entrar num site q nao te pertence!";
  27. }
  28. }
  29. ?>
  30. <html>
  31.  
  32. <head>
  33. <title>Sera que sabes a chave?</title>
  34.  
  35. <style type = "text/css">
  36. body {
  37. font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", "sans-serif";
  38. text-shadow: rgb(0, 20, 255) 0px 0px 10px, rgb(0, 126, 255) 0px 0px 10px;
  39. font-size:14px;
  40. background-color: black;
  41. margin-top: 20%;
  42. }
  43.  
  44. label {
  45. font-weight:bold;
  46. width:100px;
  47. font-size:14px;
  48. }
  49.  
  50. .box {
  51. border:dodgerblue solid 1px;
  52. background-color: black;
  53. }
  54. </style>
  55.  
  56. </head>
  57.  
  58. <body bgcolor = "black">
  59.  
  60. <div align = "center">
  61. <div style = "width:300px; border: solid 2px black; " align = "left">
  62. <div style = "background-color:black; color:black; padding:3px;"><b>Login</b></div>
  63.  
  64. <div style = "margin:30px">
  65.  
  66. <form action = "" method = "post">
  67. <label>Username :</label><input autocomplete="off" type = "text" name = "username" class = "box"/><br /><br />
  68. <label>Password :</label><input autocomplete="off" type = "password" name = "password" class = "box" /><br/><br />
  69. <input type = "submit" style="position: absolute; left: -9999px; value = " Submit "/><br />
  70. </form>
  71.  
  72. <div style = "font-size:11px; color:black; background-color: black; margin-top:10px"><?php echo $error; ?></div>
  73.  
  74. </div>
  75.  
  76. </div>
  77.  
  78. </div>
  79.  
  80. </body>
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement