-
Notifications
You must be signed in to change notification settings - Fork 2
/
adlogin.php
143 lines (140 loc) · 3.82 KB
/
adlogin.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
session_start();
$con = mysqli_connect("localhost","root","","signup");
if(!$con){
echo "connection faild";
}
else{
if(isset($_POST['go']))
{
$uname=mysqli_real_escape_string($con,$_POST['username']);
$pass=mysqli_real_escape_string($con,$_POST['password']);
if($uname!= "" && $pass !=""){
$sql_query="select count(*) as cntUser from admintable where ad_user='".$uname."' and ad_pass='".$pass."'";
$result=mysqli_query($con,$sql_query);
$row = mysqli_fetch_array($result);
$count = $row['cntUser'];
if($count>0){
$_SESSION['login'] = 'yes';
$_SESSION['uname'] = $uname;
header('Location:adhome.php');
die();
}else{
echo "invalid username and password";
}
}
}
}
?>
<html>
<head>
<title>
https://codepen.io/sonumahajan/pen/XvxQQd
</title>
<script type="text/javascript" src="myscript.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Rubik&display=swap" rel="stylesheet">
</head>
<style>
body{
background:linear-gradient(90deg,rgb(107, 139, 241),rgb(204, 71, 204));
text-align:center;
font-family: 'Rubik', sans-serif;
}
.box{
height:65%;
width:50%;
background-color:white;
position:relative;
top:15%; left:25%;
border-radius: 10px;
}
.logo{
height:60%;
position:absolute;
top:20%; left:0px;
}
h1{
position: absolute;
top:20%; right:14%;
}
#email,#pass{
position:absolute;
top:35%; right:5%;
height:7%;
width:40%;
border-radius:30px;
border-style: none;
background-color:rgb(197, 192, 192);
padding:12px 20px;
outline:none;
}
#email:hover{
border:solid rgb(13, 224, 13);
}
#pass{
top:47%;
}
#pass:hover{
border:solid rgb(13, 224, 13);
}
.login{
position:absolute;
top:59%; right:5%;
height:7%;
width:40%;
border-radius:30px;
border-style: none;
background-color: rgb(13, 224, 13);
color:white;
outline:none;
}
.login:hover{
opacity:0.6;
}
.forgot{
position:absolute;
top:67%; right:13%;
}
#UP:hover{
color:red;
}
.create{
position:absolute;
top:75%; right:15%;
color:rgb(13, 224, 13);
text-decoration: none;
}
.create:hover{
color:red;
}
.eye{
position:absolute;
right:6%;
top:49%;
font-size:20px;
color: #999;
z-index:100;
}
#eye1{
display: none;
}
</style>
<body>
<form class="box" action="#" method="post">
<img class="logo" src="photos/log.png">
<h1>Admin Login</h1>
<input id="email" name="username" type="text" placeholder="Username" maxlengt="30" required>
<br>
<span class="eye" onclick="myFunction()">
<i id="eye1" class="fa fa-eye"></i>
<i id="eye2" class="fa fa-eye-slash"></i>
</span>
<input id="pass" name="password" type="password" placeholder="Password" maxlengt="12" required>
<br>
<input class="login" name="go" type="submit" value="LOGIN">
<h4 class="forgot">Forgot <font id="UP"color="green;">Username / Password?</font></h4>
<a class="create" href="index.php">♦ For Customer Login ♦</a>
</form>
</body>
</html>