-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
128 lines (117 loc) · 4.56 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
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
<?php
session_start();
?>
<!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.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<link rel="stylesheet" href="style.css">
<title>DesignX</title>
</head>
<?php
include "condb.php";
if(isset($_POST['submit'])){
$email = $_POST['email'];
$password = $_POST['password'];
$sql = "select *from register where email='$email' AND password='$password'";
$result = mysqli_query($con,$sql);
$row = mysqli_fetch_array($result);
if ($row['usertype']=='admin') {
$_SESSION['username']= $email;
header("location:admin.php?id=$row[0]");
}elseif($row['usertype']=='user'){
$_SESSION['username']= $email;
header("location:main.php?id=$row[0]");
}else{
echo"User Not Found !!";
}
}
?>
<body>
<nav>
<label class="logo">DesignX</label>
<ul>
<li><a href="#" class="active">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">FeedBack</a></li>
</ul>
</nav>
<section id="section"></section>
<div class="center">
<h1>Login</h1>
<form method="POST" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<!-- <div class="txt_field">
<input type="text" name="username" required>
<span></span>
<label>UserName</label>
</div> -->
<div class="txt_field">
<input type="email" name="email" required>
<span></span>
<label>EmailId</label>
</div>
<div class="txt_field">
<input type="password" name="password" required>
<span></span>
<label>Password</label>
</div>
<input type="submit" class="submit" name="submit" value="Login">
<div class="login_link">
Not a Member? <a href="registration.php" class="login">Register</a> here.
</div>
</form>
</div>
<footer class="footer">
<div class="container">
<div class="row">
<div class="footer-col">
<h4>DesignX</h4>
<ul class="ul">
<li><a href="#">About Us</a></li>
<li><a href="#">Our Services</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Get Help</h4>
<ul>
<li><a href="#">FAQ</a></li>
<li><a href="#">Shipping</a></li>
<li><a href="#">Returns</a></li>
<li><a href="#">Order Status</a></li>
<li><a href="#">Payment Options</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Online Shop</h4>
<ul>
<li><a href="#">Lofer Shoes</a></li>
<li><a href="#">Formal Shoes</a></li>
<li><a href="#">Party Shoes</a></li>
<li><a href="#">Sports Shoes</a></li>
</ul>
</div>
<div class="footer-col">
<h4>Follow Us</h4>
<div class="social-link">
<a href="#"><i class="fab fa-facebook-f"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
</div>
</div>
<p class="footer-last">© 2022 DesignX All rights reserved.</p>
</footer>
</body>
</html>