<?php
include_once("./includes/main.php");
session_start();
if(isLogged()){
header("Location: .");
}
/*********************************/
$error = null;
$ready = true;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["user"])):
$error .= "Tài khoản không được để trống!<br>";
$ready = false;
else:
$user = $_POST["user"];
endif;
if (empty($_POST["pass"])):
$error .= "Mật khẩu không được để trống!<br>";
$ready = false;
else:
$pass = $_POST["pass"];
endif;
if($ready){
$conn = new mysqli('thegamingminecraft.com', '
root', '
!!--PASSWORD--!!', 'authme');
mysqli_set_charset($conn,"utf8");
$hasin = $conn->query("SELECT * FROM `authme` WHERE `username`='". $user ."'");
if ($hasin->num_rows > 0):
while($aif = $hasin->fetch_assoc()) {
$shainfo = explode("$", $aif["password"]);
$pass = hash("sha256", $pass) . $shainfo[2];
$passxxx = strcasecmp($shainfo[3], hash('sha256', $pass)) == 0;
if($passxxx):
$_SESSION["authsession"] = $user;
echo "<script>window.location.href = '.';</script><meta http-equiv='refresh' content='0; url='.'>";
else:
$error .= "Sai mật khẩu!<br>";
endif;
}
else:
$error .= "Không có tài khoản này!<br>";
endif;
$conn->close();
}
}
/*********************************/
if($error != null):
$error = '<div class="alert">'. $error .'</div>';
else:
$error = '';
endif;
?>
<!Doctype html>
<html lang="vi">
<head>
<meta charset="utf-8">
<title> TheGMC | ĐĂNG NHẬP</title>
<meta charset="utf-8">
<meta http-equiv="content-language" content="vi" />
<meta name="robots" content="noodp,index,follow">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link href="//
" rel="dns-prefetch" />
<script src="
ajax.googleapis.com" type="text/javascript"></script>
<link rel="icon" type="image/png" href="./includes/icon.png">
<link href="
cdnjs.cloudflare.com" rel="stylesheet" /> <link href="
fonts.googleapis.com" rel="stylesheet">
<link href="./includes/main.css" rel="stylesheet">
<style>
form {
padding: 0 40px;
}
input {
padding: 6px 12px;
border: 1px #e7e7e7 solid;
display: block;
margin-bottom: 20px;
min-width: 400px;
font-family: 'Open Sans', sans-serif;
line-height: 1.6;
font-size: 15px;
border-radius: 5px;
}
input:hover, input:focus {
border-color: #2380ce;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
button {
padding: 8px 16px;
font-family: 'Open Sans', sans-serif;
cursor: pointer;
color: #fff;
line-height: 1.6;
font-size: 15px;
background-color: #51c1fe;
border: none;
border-radius: 5px;
}
button:hover, button:focus {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
background-color: #fff;
color: #51c1fe;
}
</style>
</head>
<body>
<div id="warpper"></div>
<div id="menu">
<ul>
<li>
<a href="index.php"><button class="btn btn-primary btn-xs">Trang chủ</button></a>
</li>
<li>
<a href="donate.php"><button class="btn btn-primary btn-xs">Nạp thẻ</button></a>
</li>
<?php if(!isLogged()) { ?>
<li>
<a href="login.php"><button class="btn btn-primary btn-xs">Đăng nhập</button></a>
</li>
<li>
<a href="register.php"><button class="btn btn-primary btn-xs">Đăng ký</button></a>
</li>
<?php } ?>
<li>
<a href="rank.php"><button class="btn btn-primary btn-xs">Danh sách Rank</button></a>
</li>
<li>
<a href="Minecraft Launcher.exe" download><button class="btn btn-primary btn-xs">Tải Game</button></a>
</li>
</ul>
</div>
<br>
<br>
<br>
<br>
<br>
<p align="center">
<form method="post" action="">
<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>
<?php echo $error; ?><br>
<input type="text" name="user" placeholder="Tài khoản" autocomplete="off" required />
<input type="password" name="pass" placeholder="Mật khẩu" autocomplete="off" required />
<button>Đăng nhập</button> <a href="forgot.php">Quên Mật Khẩu ?</a>
</form>
</body>
</html>