Guest User

Untitled

a guest
Jun 7th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1. <?php
  2. include_once("./includes/main.php");
  3.  
  4. if(isLogged()){
  5. header("Location: .");
  6. }
  7.  
  8.  
  9. /*********************************/
  10. $error = null;
  11. $ready = true;
  12. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  13. if (empty($_POST["user"])):
  14. $error .= "Tài khoản không được để trống!<br>";
  15. $ready = false;
  16. else:
  17. $user = $_POST["user"];
  18. endif;
  19.  
  20. if (empty($_POST["pass"])):
  21. $error .= "Mật khẩu không được để trống!<br>";
  22. $ready = false;
  23. else:
  24. $pass = $_POST["pass"];
  25. endif;
  26.  
  27. if($ready){
  28. $conn = new mysqli('thegamingminecraft.com', 'root', 'TheGMCRootDB', 'authme');
  29. mysqli_set_charset($conn,"utf8");
  30. $hasin = $conn->query("SELECT * FROM `authme` WHERE `username`='". $user ."'");
  31.  
  32. if ($hasin->num_rows > 0):
  33. while($aif = $hasin->fetch_assoc()) {
  34.  
  35. $shainfo = explode("$", $aif["password"]);
  36. $pass = hash("sha256", $pass) . $shainfo[2];
  37. $passxxx = strcasecmp($shainfo[3], hash('sha256', $pass)) == 0;
  38.  
  39. if($passxxx):
  40. $_SESSION["authsession"] = $user;
  41. echo "<script>window.location.href = '.';</script><meta http-equiv='refresh' content='0; url='.'>";
  42. else:
  43. $error .= "Sai mật khẩu!<br>";
  44. endif;
  45. }
  46. else:
  47. $error .= "Không có tài khoản này!<br>";
  48. endif;
  49. $conn->close();
  50. }
  51. }
  52. /*********************************/
  53. if($error != null):
  54. $error = '<div class="alert">'. $error .'</div>';
  55. else:
  56. $error = '';
  57. endif;
  58. ?>
  59. <!Doctype html>
  60. <html lang="vi">
  61. <head>
  62. <meta charset="utf-8">
  63. <title> TheGMC | ĐĂNG NHẬP</title>
  64. <meta charset="utf-8">
  65. <meta http-equiv="content-language" content="vi" />
  66. <meta name="robots" content="noodp,index,follow">
  67. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  68. <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  69. <link href="//www.google-analytics.com" rel="dns-prefetch" />
  70. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>
  71. <link rel="icon" type="image/png" href="./includes/icon.png">
  72. <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&amp;subset=vietnamese" rel="stylesheet">
  73. <link href="./includes/main.css" rel="stylesheet">
  74. <style>
  75. form {
  76. padding: 0 40px;
  77. }
  78. input {
  79. padding: 6px 12px;
  80. border: 1px #e7e7e7 solid;
  81. display: block;
  82. margin-bottom: 20px;
  83. min-width: 400px;
  84. font-family: 'Open Sans', sans-serif;
  85. line-height: 1.6;
  86. font-size: 15px;
  87. border-radius: 5px;
  88. }
  89. input:hover, input:focus {
  90. border-color: #2380ce;
  91. -webkit-transition: all 1s ease;
  92. -moz-transition: all 1s ease;
  93. -ms-transition: all 1s ease;
  94. -o-transition: all 1s ease;
  95. transition: all 1s ease;
  96. }
  97. button {
  98. padding: 8px 16px;
  99. font-family: 'Open Sans', sans-serif;
  100. cursor: pointer;
  101. color: #fff;
  102. line-height: 1.6;
  103. font-size: 15px;
  104. background-color: #51c1fe;
  105. border: none;
  106. border-radius: 5px;
  107. }
  108. button:hover, button:focus {
  109. -webkit-transition: all 1s ease;
  110. -moz-transition: all 1s ease;
  111. -ms-transition: all 1s ease;
  112. -o-transition: all 1s ease;
  113. transition: all 1s ease;
  114. background-color: #fff;
  115. color: #51c1fe;
  116. }
  117. </style>
  118. </head>
  119. <body>
  120. <div id="warpper"></div>
  121. <div id="menu">
  122. <ul>
  123. <li>
  124. <a href="index.php"><button class="btn btn-primary btn-xs">Trang chủ</button></a>
  125. </li>
  126. <li>
  127. <a href="donate.php"><button class="btn btn-primary btn-xs">Nạp thẻ</button></a>
  128. </li>
  129. <?php if(!isLogged()) { ?>
  130. <li>
  131. <a href="login.php"><button class="btn btn-primary btn-xs">Đăng nhập</button></a>
  132. </li>
  133. <li>
  134. <a href="register.php"><button class="btn btn-primary btn-xs">Đăng ký</button></a>
  135. </li>
  136. <?php } ?>
  137. <li>
  138. <a href="rank.php"><button class="btn btn-primary btn-xs">Danh sách Rank</button></a>
  139. </li>
  140. <li>
  141. <a href="Minecraft Launcher.exe" download><button class="btn btn-primary btn-xs">Tải Game</button></a>
  142. </li>
  143. </ul>
  144. </div>
  145. <br>
  146. <br>
  147. <br>
  148. <br>
  149. <br>
  150. <p align="center">
  151. <form method="post" action="">
  152. <h4 class="modal-title"><span style="font-size: 12pt; font-family: 'comic sans ms', sans-serif;">XIN HÃY NHẬP ĐÚNG TÊN VÀ MẬT KHẨU! </span></h4>
  153. <?php echo $error; ?><br>
  154. <input type="text" name="user" placeholder="Tài khoản" autocomplete="off" required />
  155. <input type="password" name="pass" placeholder="Mật khẩu" autocomplete="off" required />
  156. <button>Đăng nhập</button> <a href="forgot.php">Quên Mật Khẩu ?</a>
  157. </form>
  158. </body>
  159. </html>
Advertisement
Add Comment
Please, Sign In to add comment