-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
95 lines (79 loc) · 3.3 KB
/
index.php
File metadata and controls
95 lines (79 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
if($_POST){
$dbServername = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbName = "gym_database";
$conn = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
$username = $_POST['User Name'];
$password = $_POST['Password'];
$query = "SELECT * FROM `users` WHERE `User Name`='$username' AND `Password` = '$password';";
$result = mysqli_query($conn, $query);
if (!$result || mysqli_num_rows($result) == 0){
session_start();
$_SESSION['gym_database']='true';
header('location:home.php');
}
else {echo "WRONG USERNAME OR PASSWORD";}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Cache-control" content="no-cache">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
<title>THE ENERGY HUB</title>
<!-- Favicons -->
<link href="img/favicon.jpg" rel="icon">
<!-- Bootstrap core CSS -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!--external css-->
<link href="lib/font-awesome/css/font-awesome.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Acme&family=Kalam:wght@300;400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Acme', sans-serif;
font-family: 'Kalam', cursive;
}
</style>
</head>
<body>
<!-- **********************************************************************************************************************************************************
MAIN CONTENT
*********************************************************************************************************************************************************** -->
<div style="background-image: url('img/gym.jpg'); height: 100vh; background-position: center; background-repeat: no-repeat; background-size: cover;">
<div id="login-page">
<div class="container">
<form class="form-login" action="" method="POST">
<h2 class="form-login-heading">ADMIN ACCESS</h2>
<div class="login-wrap">
<input type="text" class="form-control" placeholder="User Name" id="username" name="user" autofocus required>
<br>
<input type="password" class="form-control" placeholder="Password" id="password" name="pass" required>
<br>
<button class="btn btn-theme btn-block" type="submit" value="Login" name="submit"><i class="fa fa-lock"><br></i>LOGIN NOW</button>
<hr>
</div>
</form>
</div>
</div>
<!-- js placed at the end of the document so the pages load faster -->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<!--BACKSTRETCH-->
<!-- You can use an image of whatever size. This script will stretch to fit in any screen size.-->
<script type="text/javascript" src="lib/jquery.backstretch.min.js"></script>
<script>
$.backstretch("img/login-bg.jpg", {
speed: 500
});
</script>
</body>
</html>