Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'includes/db.php';
- require 'includes/init.php';
- ?>
- <html lang="en" class="no-js"><head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
- <meta name="description" content="">
- <meta name="author" content="">
- <title>Genetic Gaming Roleplay - Login</title>
- <!-- Font awesome -->
- <link rel="stylesheet" href="css/font-awesome.min.css">
- <!-- Sandstone Bootstrap CSS -->
- <link rel="stylesheet" href="css/bootstrap.min.css">
- <!-- Bootstrap Datatables -->
- <link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
- <!-- Bootstrap social button library -->
- <link rel="stylesheet" href="css/bootstrap-social.css">
- <!-- Bootstrap select -->
- <link rel="stylesheet" href="css/bootstrap-select.css">
- <!-- Bootstrap file input -->
- <link rel="stylesheet" href="css/fileinput.min.css">
- <!-- Awesome Bootstrap checkbox -->
- <link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
- <!-- Admin Stye -->
- <link rel="stylesheet" href="css/style.css">
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- <body>
- <div class="login-page bk-img" style="background-image: url(img/login-bg.jpg);">
- <div class="form-content">
- <div class="container">
- <div class="row">
- <div class="col-md-6 col-md-offset-3">
- <h1 class="text-center text-bold text-light mt-4x">Genetic Gaming Roleplay</h1><br>
- <div class="well row pt-2x pb-3x bk-light">
- <div class="col-md-8 col-md-offset-2">
- <?php
- if (!($user -> LoggedIn()))
- {
- if (isset($_POST['loginBtn']))
- {
- $username = $_POST['username'];
- $password = hash('whirlpool', $_POST['password']);
- $errors = array();
- if (empty($username) || empty($password))
- {
- $errors[] = 'Please fill in all fields';
- }
- if (empty($errors))
- {
- $SQLCheckLogin = $odb -> prepare("SELECT COUNT(*) FROM `accounts` WHERE `Username` = :username AND `Key` = :password");
- $SQLCheckLogin -> execute(array(':username' => $username, ':password' => $password));
- $countLogin = $SQLCheckLogin -> fetchColumn(0);
- if ($countLogin == 1)
- {
- $SQLGetInfo = $odb -> prepare("SELECT `Username`, `id` FROM `accounts` WHERE `username` = :username AND `Key` = :password");
- $SQLGetInfo -> execute(array(':username' => $username, ':password' => $password));
- $userInfo = $SQLGetInfo -> fetch(PDO::FETCH_ASSOC);
- if ($userInfo['Band'] == 0)
- {
- $_SESSION['Username'] = $userInfo['Username'];
- $_SESSION['id'] = $userInfo['id'];
- echo '<div class="alert alert-success"><p><strong>SUCCESS: </strong>Welcome!! Login Successful. Redirecting....</p></div><meta http-equiv="refresh" content="3;url=index.php">';
- }
- else
- {
- echo '<div class="alert alert-danger"><p><strong>ERROR: </strong>Your user was banned</p></div>';
- }
- }
- else
- {
- echo '<div class="alert alert-danger"><p><strong>ERROR: </strong>Login Failed</p></div>';
- }
- }
- else
- {
- echo '<div class="alert alert-danger"><p><strong>ERROR:</strong><br />';
- foreach($errors as $error)
- {
- echo '-'.$error.'<br />';
- }
- echo '</div>';
- }
- }
- }
- else
- {
- header('location: index.php');
- }
- ?>
- <form action="" id="validate" class="form" method="POST">
- <label for="" class="text-uppercase text-sm">Username</label>
- <input type="text" name="username" id="username" placeholder="Your username" class="form-control mb">
- <label for="" class="text-uppercase text-sm">Password</label>
- <input type="password" name="password" id="password" placeholder="Your password" value=""class="form-control mb">
- <button class="btn btn-primary btn-block" type="submit" value="Login" name="loginBtn">LOGIN</button>
- </form>
- </div>
- </div>
- <div class="text-center text-light">
- <a href="#" class="text-light">Forgot password?</a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- Loading Scripts -->
- <script src="js/jquery.min.js"></script>
- <script src="js/bootstrap-select.min.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <script src="js/jquery.dataTables.min.js"></script>
- <script src="js/dataTables.bootstrap.min.js"></script>
- <script src="js/Chart.min.js"></script>
- <script src="js/fileinput.js"></script>
- <script src="js/chartData.js"></script>
- <script src="js/main.js"></script>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement