-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
88 lines (73 loc) · 2.47 KB
/
login.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
<?php
$message="";
$message1="";
require_once('connect.php');
if(isset($_POST['submit']))
{
$em = $_POST['email'];
$pass = md5( $_POST['pwd']);
if(!(empty($em) && empty($pass)))
{
$query = "SELECT * FROM `registration` where email = '$em' and password = '$pass'";
$result = mysqli_query($connect, $query);
$a=$result->fetch_assoc();
$name=$a['name'];
$aadh=$a['aadhaar'];
$number=$a['number'];
$count = mysqli_num_rows($result);
if($count > 0)
{
session_start();
$_SESSION["email"] = $em;
$_SESSION["aadh"] = $aadh;
$_SESSION["name"] = $name;
$_SESSION["phone"] = $number;
header("location: home.php");
}
else
{
$message= "Please Check your e-mail ";
$message1= "Please Check your password";
}
}
}
?>
<html>
<head>
<meta name="viewport" content="with=device-width, initial-scale=1.0">
<title>Login Page</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section>
<nav>
<h1>Scholarship</h1>
<div class="navlink">
<ul>
<li><a href="about.html">About</a></li>
<li><a href="registration.php">Registration</a></li>
</ul>
</div>
</nav>
</section>
<section class="header">
<div class="login-box">
<h1 style="color: orange;"> Login </h1>
<form method = "POST" action="login.php">
<div class="textbox">
<i class="fas fa-user"></i>
<input type="email" name="email" placeholder="Enter your Email"/>
</div>
<div class="message1"><?php echo"$message"; ?></div>
<div class="textbox">
<i class="fas fa-lock"></i>
<input type="password" name="pwd" placeholder="Enter your Password"/>
</div>
<div class="message1"><?php echo"$message1"; ?></div>
<input type="submit" class="btn" value="Log in" name="submit">
<div class="signup">
Not Registered ? <a href = "registration.php"> Register </a>
</div>
</section>
</body>
</html>