Advertisement
Guest User

Untitled

a guest
Dec 26th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. <?php
  2. require 'includes/db.php';
  3. require 'includes/init.php';
  4. ?>
  5.  
  6. <html lang="en" class="no-js"><head>
  7. <meta charset="UTF-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
  10. <meta name="description" content="">
  11. <meta name="author" content="">
  12.  
  13. <title>Genetic Gaming Roleplay - Login</title>
  14.  
  15. <!-- Font awesome -->
  16. <link rel="stylesheet" href="css/font-awesome.min.css">
  17. <!-- Sandstone Bootstrap CSS -->
  18. <link rel="stylesheet" href="css/bootstrap.min.css">
  19. <!-- Bootstrap Datatables -->
  20. <link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
  21. <!-- Bootstrap social button library -->
  22. <link rel="stylesheet" href="css/bootstrap-social.css">
  23. <!-- Bootstrap select -->
  24. <link rel="stylesheet" href="css/bootstrap-select.css">
  25. <!-- Bootstrap file input -->
  26. <link rel="stylesheet" href="css/fileinput.min.css">
  27. <!-- Awesome Bootstrap checkbox -->
  28. <link rel="stylesheet" href="css/awesome-bootstrap-checkbox.css">
  29. <!-- Admin Stye -->
  30. <link rel="stylesheet" href="css/style.css">
  31.  
  32. <!--[if lt IE 9]>
  33. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  34. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  35. <![endif]-->
  36.  
  37. </head>
  38.  
  39. <body>
  40.  
  41. <div class="login-page bk-img" style="background-image: url(img/login-bg.jpg);">
  42. <div class="form-content">
  43. <div class="container">
  44. <div class="row">
  45. <div class="col-md-6 col-md-offset-3">
  46. <h1 class="text-center text-bold text-light mt-4x">Genetic Gaming Roleplay</h1><br>
  47. <div class="well row pt-2x pb-3x bk-light">
  48. <div class="col-md-8 col-md-offset-2">
  49. <?php
  50. if (!($user -> LoggedIn()))
  51. {
  52. if (isset($_POST['loginBtn']))
  53. {
  54. $username = $_POST['username'];
  55. $password = hash('whirlpool', $_POST['password']);
  56. $errors = array();
  57. if (empty($username) || empty($password))
  58. {
  59. $errors[] = 'Please fill in all fields';
  60. }
  61.  
  62. if (empty($errors))
  63. {
  64. $SQLCheckLogin = $odb -> prepare("SELECT COUNT(*) FROM `accounts` WHERE `Username` = :username AND `Key` = :password");
  65. $SQLCheckLogin -> execute(array(':username' => $username, ':password' => $password));
  66. $countLogin = $SQLCheckLogin -> fetchColumn(0);
  67. if ($countLogin == 1)
  68. {
  69. $SQLGetInfo = $odb -> prepare("SELECT `Username`, `id` FROM `accounts` WHERE `username` = :username AND `Key` = :password");
  70. $SQLGetInfo -> execute(array(':username' => $username, ':password' => $password));
  71. $userInfo = $SQLGetInfo -> fetch(PDO::FETCH_ASSOC);
  72. if ($userInfo['Band'] == 0)
  73. {
  74. $_SESSION['Username'] = $userInfo['Username'];
  75. $_SESSION['id'] = $userInfo['id'];
  76. 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">';
  77. }
  78. else
  79. {
  80. echo '<div class="alert alert-danger"><p><strong>ERROR: </strong>Your user was banned</p></div>';
  81. }
  82. }
  83. else
  84. {
  85. echo '<div class="alert alert-danger"><p><strong>ERROR: </strong>Login Failed</p></div>';
  86. }
  87. }
  88. else
  89. {
  90. echo '<div class="alert alert-danger"><p><strong>ERROR:</strong><br />';
  91. foreach($errors as $error)
  92. {
  93. echo '-'.$error.'<br />';
  94. }
  95. echo '</div>';
  96. }
  97. }
  98. }
  99. else
  100. {
  101. header('location: index.php');
  102. }
  103. ?>
  104. <form action="" id="validate" class="form" method="POST">
  105.  
  106. <label for="" class="text-uppercase text-sm">Username</label>
  107. <input type="text" name="username" id="username" placeholder="Your username" class="form-control mb">
  108.  
  109. <label for="" class="text-uppercase text-sm">Password</label>
  110. <input type="password" name="password" id="password" placeholder="Your password" value=""class="form-control mb">
  111.  
  112.  
  113.  
  114. <button class="btn btn-primary btn-block" type="submit" value="Login" name="loginBtn">LOGIN</button>
  115.  
  116. </form>
  117. </div>
  118. </div>
  119. <div class="text-center text-light">
  120. <a href="#" class="text-light">Forgot password?</a>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127.  
  128. <!-- Loading Scripts -->
  129. <script src="js/jquery.min.js"></script>
  130. <script src="js/bootstrap-select.min.js"></script>
  131. <script src="js/bootstrap.min.js"></script>
  132. <script src="js/jquery.dataTables.min.js"></script>
  133. <script src="js/dataTables.bootstrap.min.js"></script>
  134. <script src="js/Chart.min.js"></script>
  135. <script src="js/fileinput.js"></script>
  136. <script src="js/chartData.js"></script>
  137. <script src="js/main.js"></script>
  138.  
  139.  
  140.  
  141. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement