-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
132 lines (117 loc) · 4.56 KB
/
index.php
File metadata and controls
132 lines (117 loc) · 4.56 KB
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
129
130
131
132
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign up</title>
<link rel="shortcut icon" href="fevicon.png">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://kit.fontawesome.com/9e5ba2e3f5.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css">
<link rel="stylesheet" href="css/login.css" type="text/css">
</head>
<body>
<?php
require "connect.php";
error_reporting(0);
if(isset($_POST['u_name'])&& !empty($_POST['pass'])){
session_start();
$_SESSION['username']=$_POST['u_name'];
echo '<script> alert($_SESSION[`username`])</script>';
//echo $_SESSION['username'];
$u_name=$_SESSION['username'];
$pass=$_POST['pass'];
$sql="select * from login where username='$u_name' and
password='$pass'";
$q=$conn->query($sql);
$count=mysqli_num_rows($q);
if($count){
$userdata=mysqli_fetch_array($q);
if($userdata['type']==="A"){
echo '<div class="alert alert-success alert-dismissible fade show" role="alert" style=" width:100%; position: fixed; top: 0; left: 0; ">
<strong>Sucess!</strong> Login Successful as admin.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>';
// echo "<script>alert('');</script>";
echo '<META HTTP-EQUIV="Refresh" Content="1; URL=info-2.php">';
}else{
echo '<div class="alert alert-success alert-dismissible fade show" role="alert" style=" width:100%; position: fixed; top: 0; left: 0; ">
<strong>Sucess!</strong> Login Successful.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>';
// echo"<script> alert ('Login successful')</script>" ;
echo'<META HTTP-EQUIV="Refresh" Content="0.9;URL=info-1.php">';
}
}
else{
echo "<script>alert('Unable to Login...! ');</script>";
}
}
?>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="login">
<div class="wrapper">
<div class="form-container sign-in">
<form name="login" method="post" action="index.php">
<h1>Login</h1>
<!-- UserName -->
<div class="form-group">
<input type="name" class="form-control" id="u_name" name="u_name" required>
<i class="fas fa-user"></i>
<label for="">Username</label>
</div>
<!-- Password -->
<div class="form-group ">
<input type="password" class="password" id="pass" name="pass" required>
<i class="fas fa-lock"></i>
<label for="">Password</label>
<label for="">Password</label>
<i class="fas fa-lock"></i>
</div>
<div class="okay col-3 col-sm-5 col-lg-5 "><i class="eyee uil uil-eye-slash"></i></div>
<script>
eyee = document.querySelector(".eyee"),
input =document.querySelector(".password");
eyee.addEventListener("click", function(){
if(input.type==='password'){
input.setAttribute('type','text');
eyee.classList.replace("uil-eye-slash","uil-eye");
}else{
input.setAttribute('type','password');
eyee.classList.replace("uil-eye","uil-eye-slash");
}
})
</script>
<!-- FORGET PASSWORD -->
<div class="forgot-pass">
<a href="ForgotPassword2/verification.php">forgot password?</a>
</div>
<!-- SubmitButton -->
<br>
<button type="submit" class="btn btn-lg btn-block btn-success">Sign in</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<style>
.eyee{
font-size:30px;
cursor:pointer;
}
.okay{
cursor:pointer;
position:absolute;
right:7px;
transform:translate(0,-50%);
top:65%;
}
</style>
</html>