Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 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: welcome.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>Knock Knock</title>
  34. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  35. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
  36. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  37.  
  38. <style type = "text/css">
  39. body {
  40. font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", "sans-serif";
  41. text-shadow: rgb(0, 20, 255) 0px 0px 10px, rgb(0, 126, 255) 0px 0px 10px;
  42. font-size:14px;
  43. background-color: black;
  44. margin-top: 20%;
  45. }
  46.  
  47. label {
  48. font-weight:bold;
  49. width:100px;
  50. font-size:14px;
  51. }
  52.  
  53. .box {
  54. border:dodgerblue solid 1px;
  55. background-color: black;
  56. }
  57. body, html{
  58. overflow-y: hidden;
  59. overflow-x: hidden;
  60. color: ghostwhite;
  61. }
  62. #someid {
  63. position: absolute;
  64. width: 300px;
  65. height: 100px;
  66. z-index: 15;
  67. top: 50%;
  68. left: 50%;
  69. margin: -50px 0 0 -150px;
  70. }
  71. </style>
  72. <link rel="stylesheet" type="text/css" href="animations.css">
  73.  
  74.  
  75. </head>
  76.  
  77. <body bgcolor = "black">
  78. <div class="row ">
  79. <div class=" animated fadeIn " id="someid">
  80. <div align = "center">
  81.  
  82. <form action = "" method = "post">
  83. <label>Username :</label><input autocomplete="off" type = "text" name = "username" class = "box"/><br /><br />
  84. <label>Password :</label><input autocomplete="off" type = "password" name = "password" class = "box" /><br/><br />
  85. <input type = "submit" style="position: absolute; left: -9999px; value = " Submit "/><br />
  86. </form>
  87.  
  88. <div style = "font-size:11px; color:black; background-color: black; margin-top:10px"><?php echo $error; ?></div>
  89.  
  90. </div>
  91.  
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96.  
  97. </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement