-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
82 lines (73 loc) · 2.29 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
<?php
session_start();
error_reporting(0);
include('includes/connect.php');
if($_SESSION['login']!=''){
$_SESSION['login']='';
}
if(isset($_POST['login']))
{
$email=$_POST['emailid'];
$password=md5($_POST['password']);
$sql ="SELECT EmailId,Password,StudentId FROM tblstudents WHERE EmailId='$email' and Password='$password'";
$query= mysqli_query($connect,$sql);
if(mysqli_num_rows($query) > 0)
{
$result = mysqli_fetch_assoc($query);
$_SESSION['stdid']=$result['StudentId'];
$_SESSION['login']=$_POST['emailid'];
echo "<script type='text/javascript'> document.location ='dashboard.php'; </script>";
}
else{
echo "<script>alert('Invalid Details');</script>";
}
}
?>
<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8" />
<title>Online Library Management System | </title>
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<link href="assets/css/style.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
<script src="assets/js/validation.js"></script>
</head>
<body background="assets/img/red.jpg">
<?php include('includes/header.php');?>
<div class="content-wrapper">
<div class="container">
<div class="row pad-botm">
<div class="col-md-12">
<h4 class="header-line">USER LOGIN FORM</h4>
</div>
</div>
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3" >
<div class="panel panel-info">
<div class="panel-heading">
LOGIN FORM
</div>
<div class="panel-body">
<form role="form" name="loginform" method="post">
<div class="form-group">
<label>Enter Email id</label>
<input class="form-control" type="text" id="email" name="emailid" required autocomplete="off" />
</div>
<div class="form-group">
<label>Password</label>
<input class="form-control" type="password" name="password" required autocomplete="off" />
<p class="help-block"><a href="user-forgot-password.php">Forgot Password</a></p>
</div>
<button type="submit" onclick ="return ValidateUserLogin()" name="login" class="btn btn-info" >LOGIN </button> | <a href="signup.php">Not Register Yet</a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include('includes/footer.php');?>
</body>
</html>