-
Notifications
You must be signed in to change notification settings - Fork 7
/
login.php
executable file
·107 lines (97 loc) · 3.82 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
session_start();
include_once 'php_includes/dbconnect.php';
include 'php_includes/logged_in_redirect.php';
if(isset($_POST['btn-login']))
{
$roll_no = trim($_POST['roll_no']);
$pass = trim($_POST['pass']);
$q1="SELECT roll_no,pass FROM ldap WHERE roll_no = ?";
$q1_result = $conn->prepare($q1);
$q1_result->execute([$roll_no]);
$row = $q1_result->fetch(PDO::FETCH_ASSOC);
if(count($row) > 0 && password_verify($pass,$row['pass'])){
$_SESSION['user'] = $row['roll_no'];
header("Location: edit");
}else{
?>
<script>alert('Username / Password Seems Wrong !');</script>
<?php
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>profileserver</title>
<!-- Stylesheets -->
<!--Import materialize.css-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<link rel="stylesheet" type="text/css" href="css/temp_login.css">
<!-- JavaScripts -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script type="text/javascript" src="js/ldap_login.js"></script>
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<nav>
<div class="nav-wrapper teal lighten-1" id="na lighten-1v-wrapper">
<a href="#" class="brand-logo" id="header-logo">
<img src="images/logo.jpg">
</a>
<ul id="nav-mobile" class="right hide-on-med-and-down black-text">
<li><a href="register" id="header-signup" style="color:white; font-size:20px; font-family:Robota;"><b>Sign Up</a></li>
</ul>
</div>
</nav>
<div id="head" >
<div class="section no-pad-bot">
<h1><center> Sign In </center> </h1>
<div class="container" style="width:500px;">
<div id="login-form" class="center">
<form method="post" >
<center>
<table class="center" style=" width:80%; height=30%; backgroung:white; border-collapse:separate; border-spacing: 5px; border-radius:6px;">
<tr bgcolor="#e0e0e0">
<td>
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input class="validate id="icon_prefix" type="text" name="roll_no" required ">
<label for="icon_prefix">Your Roll No</label>
</div>
</td>
</tr>
<tr bgcolor="#e0e0e0">
<td>
<div class="row">
<div class="input-field col s12 " >
<i class="material-icons prefix">mode_edit</i>
<input class="validate id="icon_prefix" type="password" name="pass" required ">
<label for="icon_prefix">Your Password</label>
</div>
</td>
</tr>
<div class="container" style="backgroung:#006064">
<tr>
<td><button type="submit" name="btn-login">Sign In</button></td>
</tr>
<tr>
<td><button type="button" name="signup" onclick ="window.location.assign('register')">Create a New Account</button></td>
</tr>
</div>
</table>
</center>
</form>
</div>
</div>
<br><br>
</div>
</div>
</body>
</html>