-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgaurd.php
79 lines (75 loc) · 2.19 KB
/
gaurd.php
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
<?php
require("dbase.php");
if(isset($_POST['submit']))
{
$sql="select * from sec_reg";
$result = $conn->query($sql);
if ($result->num_rows > 0)
{
while($row = $result->fetch_assoc()) {
if($row['sid']==$_POST['sid']&&$row['pass']==$_POST['pass'])
{
$row['pass'] = "******";
$JSON = json_encode($row);
$a=1;
}
}
}
if($a==1)
{
header('Location:gaurd/index.php?JSON='.$JSON);
}
if($a!=1)
{
echo '<p class="row col s12 red white-text center">Wrong Credentials</p>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>DOS - Digitizing DIT</title>
<!-- CSS -->
<style>
.student{}
.teacher{}
.security{}
</style>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
</head>
<body style="background:rgb(235,161,53);">
<div class="container" style="background:rgba(0,0,0,0.3);margin-top:5vh;">
<div class="row">
<div class="col s1"></div>
<div class="col s10 center white-text">
<h1>Security Login Page</h1>
<img class="col s4 offset-s4" src="images/sec.jpg" class="col s12" />
</div>
<div class="col s1"></div>
</div>
<form action="" method="POST">
<div class="row input-field">
<div class="container">
<p class="col s3 white-text">ID</p><input required name="sid" class="col s9 white-text" />
<p class="col s3 white-text">Password</p><input required name="pass" type="password" class="col s9" />
</div>
</div>
<div class="section"></div>
<div class="row">
<div class="col s12 center white-text">
<input type="submit" name="submit" class="btn" value="Login" />
</div>
</div>
</form>
<div class="section"></div>
</div>
<!-- Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.js"></script>
<script src="js/init.js"></script>
</body>
</html>