-
Notifications
You must be signed in to change notification settings - Fork 3
/
forget.php
136 lines (112 loc) · 2.53 KB
/
forget.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
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Nanum+Gothic" rel="stylesheet">
<style>
@media screen and (min-width: 50rem) {
.outer-box-frame {
border: 0.3rem solid #B22222;
margin-left: 5rem ;
padding: 5rem;
max-width: 3800rem; // min-width - 2(padding + border)
}
body {
background-color: #6C8C4C;
}
}
.outer-box-frame {
background-color: #fff;
}
body{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 60px;
background-color: azure ;
font-family: 'Nanum Gothic', sans-serif;
font-size: 100%
}
h1 {
margin-left: 10px;
font-color: #00008B;
font-family: 'Nanum Gothic', sans-serif;
font-size: 30px;
}
form.a
{
font-family: 'Nanum Gothic', sans-serif;
margin-left: 200px;
font-size: 14px;
font-color: BlanchedAlmond;
}
input.b{
border-radius: 1px;
border: none;
text-align: center;
font-size: 18px;
padding: 8px;
width: 110px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
align:center;
color: #800000
font-family: 'Nanum Gothic', sans-serif;
margin-left: 50px;
margin-top: 20px;
}
input.b {
content: "";
clear: both;
display: table;
}
input.b {
border-right: none;
}
input.b:hover {
background-color: #B0E0E6;
font-family: 'Nanum Gothic', sans-serif;
font-size: 16px;
}
input.c
{
margin-left: 23px;
}
</style>
<div class="outer-box-frame">
<body>
<center><h1>Forget Password</h1></center>
<form action="" method="POST" class="a">
Email ID: <input type="text" name="emai"><br /> <br>
<input type="submit" value="SUBMIT" name="submit" class="b"/>
</form>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['emai'])) {
$emai=$_POST['emai'];
$con = mysqli_connect('localhost','root','') or die(mysql_erro());
mysqli_select_db($con,'mydb') or die("cannot select DB");
$query=mysqli_query($con,"SELECT * FROM login WHERE email='".$emai."'");
$numrows=mysqli_num_rows($query);
if($numrows!=0)
{
while($row=mysqli_fetch_assoc($query))
{
$dbemail=$row['email'];
}
if($emai == $dbemail)
{
session_start();
$_SESSION['sess_emai']=$emai;
header("Location: reset.php");
}
} else {
echo "Warning: Invalid Email Id !";
}
} else {
echo "All fields are required !";
}
}
?>
</div>
</head>
</html>