-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
131 lines (102 loc) · 3.48 KB
/
index.php
File metadata and controls
131 lines (102 loc) · 3.48 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
session_start();
define('mai',TRUE);
require_once('production/includes/config.php');
if(isset($_POST['login']))
{
if(!empty($_POST['username']) && !empty($_POST['password']))
{
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "select * from users where username = '".$username."' and password = '".$password."'";
$rs = mysqli_query($mysqli,$sql);
$getNumRows = mysqli_num_rows($rs);
if($getNumRows == 1)
{
$getUserRow = mysqli_fetch_assoc($rs);
unset($getUserRow['password']);
$_SESSION = $getUserRow;
header('location:main.php?id=true');
exit;
}
else
{
$errorMsg = "Wrong username or password";
}
}
}
if(isset($_GET['logout']) && $_GET['logout'] == true)
{
session_destroy();
header("location:index.php");
exit;
}
if(isset($_GET['lmsg']) && $_GET['lmsg'] == true)
{
$errorMsg = "Login required to access dashboard";
}
if (isset($_SESSION['previous'])) {
if (basename($_SERVER['PHP_SELF']) != $_SESSION['previous']) {
session_destroy();
### or alternatively, you can use this for specific variables:
### unset($_SESSION['varname']);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="production/images/crescent.jpg" type="image/ico" />
<title>CRESCENT WELFARE ASSOCIATION | </title>
<!-- Bootstrap -->
<link href="vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- NProgress -->
<link href="vendors/nprogress/nprogress.css" rel="stylesheet">
<!-- Animate.css -->
<link href="vendors/animate.css/animate.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="build/css/custom.min.css" rel="stylesheet">
</head>
<body class="login">
<div>
<a class="hiddenanchor" id="signup"></a>
<a class="hiddenanchor" id="signin"></a>
<div>
<center><h3><img src="production/images/cres.png" height="10%" width="10%"> CRESCENT WELFARE ASSOCIATION </h3></center>
</div>
<div class="login_wrapper">
<div class="animate form login_form">
<section class="login_content">
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<h1>Login Form</h1>
<div>
<input type="text" class="form-control" placeholder="Username" name="username" required="" />
</div>
<div>
<input type="password" class="form-control" placeholder="Password" name="password" required="" />
</div>
<div>
<button class="btn btn-primary btn-block" type="submit" name="login">Login</button>
<a class="reset_pass" href="#">Lost your password?</a>
</div>
</form>
<div class="clearfix"></div>
<div class="clearfix"></div>
<br />
<div>
<p>Copyright © <a href="https://juntossoft.com"><b>juntos software solution.</b></a><br>
All rights reserved.</p>
</div>
</section>
</div>
</div>
</div>
</body>
</html>