-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
99 lines (78 loc) · 2.06 KB
/
index.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
<html>
<?php session_start();
?>
<head>
<meta charset="utf-8">
<title>login Page</title>
<link href="login.css" rel="stylesheet"
type="text/css" media="all" />
</head>
<style type="text/css">
body
{
background: url('images/bestbg.jpg');
height:100%;
background-size: cover;
}
html{
background: url('images/bestbg.jpg') ;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height:100%;
}
h1{
color: white;
}
</style>
<body id="bodybg">
<h1 class="topic">Restaurant Review and Reserve</h1>
<div class="wthree-form">
<h2>LOGIN</h2>
<div class="w3l-login form">
<form method="POST">
<div class="form-sub-w3">
<input type="text" id="username" name="username" placeholder="User Id" required=""/>
</div>
<div class="form-sub-w3">
<input type="password" id="password" name="password" placeholder="Password" required=""/>
</div>
<label class="anim">
<input type="checkbox" class="checkbox">
<span>Remember Me</span>
</label>
<div class="submit-agileits">
<input type="submit" name="submit" value="Login">
</div>
<?php
$host="remotemysql.com";
$dbusername="M2M1cnixjh";
$dbpassword="RMelnhl7c8";
$db="M2M1cnixjh";
$cn=mysqli_connect($host, $dbusername, $dbpassword, $db);
if(isset($_POST['submit'])){
$username=$_POST['username'];
$password=$_POST['password'];
$_SESSION['username'] = $_POST['username'];
$sql="select * from customer where username='".$username."' AND
password='".$password."'";
$res=mysqli_query($cn,$sql);
if(mysqli_num_rows($res)==1){
echo "You have successfully logged in";
header("location: home.html");
die();
}
else{
echo "<font color='red'>Incorrect USESRNAME or
PASSWORD</font>";
die();
}
}
?>
<a href="signup.php">Dont have account 😯 press here</a>
</form>
</div>
</div>
</body>
</html>