-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.php
66 lines (52 loc) · 1.34 KB
/
log.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
<?php
$conn = mysqli_connect("localhost", "root", "p", "mp_1");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if(isset($_POST['usname'])){
$usname=$_POST['usname'];
$pwd=$_POST['pwd'];
$sql="select * from logins where UAcc='".$usname."' AND Pwd='".$pwd."'limit 1";
$result = $conn->query($sql);
if($result->num_rows == 0){
echo "You have logged in";
exit();
}
else{
echo "Incorrect info!!";
exit();
}
}
$conn->close();
?>
<html>
<head>
<title>Erdiagram</title>
<link rel="stylesheet" type="text/css" href="log_style.css">
<body>
<style>
body{
margin: 0;
padding: 0;
background: url(DBERD.jpg);
background-size: cover;
background-position: center;
font-family: sans-serif;
}
</style>
<!--<div class="loginbox">
<img src="log_avatar.png" class="avatar">
<h1>Login Here</h1>
<form method="POST" action="#">
<p>Username</p>
<input type="text" name="usname" placeholder="Enter Username">
<p>Password</p>
<input type="password" name="pwd" placeholder="Enter Password">
<input type="submit" name="" value="Login">
<a href="home.php">Login as Guest</a>
</form>
</div>-->
</body>
</head>
</html>