-
Notifications
You must be signed in to change notification settings - Fork 1
/
adminlogin.php
132 lines (105 loc) · 3.97 KB
/
adminlogin.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
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
132
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="puzzlepedia is a website for puzzle lovers wherein they can solve variety of puzzles, practise it and compete with others. Designed and developed by rahul bagad">
<meta name="author" content="">
<link rel="icon" href="puz.png">
<title>PuzzlePedia</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="css/f2.css" rel="stylesheet">
<style>
.item {
max-width: 100%;
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
.item:hover {
-moz-transform: scale(1.1);
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
</style>
</head>
<body>
<div class="modal-body">
<form class="form" method="post" action="adminlogin.php">
<div class="form-group">
<label for="email">Email address:</label>
<input type="email" class="form-control" name="lemail" required>
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" name="lpwd" required>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<?php
require 'connect.inc.php';
require 'core.inc.php';
if(isset($_POST['lemail'])&&isset($_POST['lpwd']))
{
$eid = trim($_POST['lemail']); $pwd=trim($_POST['lpwd']);
if(!empty($eid) && !empty($pwd))
{
$pwdhash=md5($pwd);
$query = "SELECT * FROM `userinfo` WHERE trim(`email`) = '$eid' AND trim(`password`) = '$pwdhash' ";
if( $query_run = mysqli_query($con,$query) )
{
$result = $con->query($query);
if ($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
$_SESSION['id']=$row['id'];
$_SESSION['eid']=$row['email'];
$_SESSION['name']=$row['name'];
$_SESSION['contact']=$row['contact'];
$_SESSION['score']=$row['score'];
echo mysqli_error($con);
?>
<script type="text/javascript">
alert("Successfully Logged In..");
</script>
<?php
header("Refresh:0; url=evaluate.php");
}
}
else
{
?>
<script type="text/javascript">
alert("invalid Login Id or Password");
</script>
<?php
}
}
else
{
?>
<script type="text/javascript">
alert("Sorry an error Ocurred . Try again later");
</script>
<?php
}
}
else
{
?>
<script type="text/javascript">
alert("Please fill in all fields");
</script>
<?php
}
}
?>
</body>