-
Notifications
You must be signed in to change notification settings - Fork 2
/
logger.php
45 lines (34 loc) · 1.24 KB
/
logger.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
<html>
<head>
<title>passCheck</title>
</head>
<body>
<?php
include 'connection.php';
$recid=$_POST['userid'];
$recpass=$_POST['pass'];
$sql = "SELECT password FROM login where username='$recid'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$pass=$row["password"];
}
} else {
echo "<script type='text/javascript'> { alert('No entries found with this username.');} window.location.replace('login.php');</script>";
}
if(strcmp($recpass,$pass)==0)
{
session_start();
$_SESSION['user_id'] = $recid;
echo "<script type='text/javascript'> window.location.replace('home.php');</script>";
}
else{
header("Refresh:0; URL=redir-login.php");
die();
}
$conn->close();
// Check connection
?>
</body>
</html>