-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgetpassword.php
More file actions
199 lines (158 loc) · 6.57 KB
/
Copy pathforgetpassword.php
File metadata and controls
199 lines (158 loc) · 6.57 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?php
session_start();
$con = mysqli_connect("localhost","root","","projectweb");
if(!empty($_SESSION["id"])){
$id = $_SESSION["id"];
$result = mysqli_query($con,"select *from user where id ='$id'");
$row = mysqli_fetch_assoc($result);
if($row['id'] == $id){
header("Location: home.php");
}
}
?>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/bootstrap.css">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="style1.css">
</head>
<body>
<header>
<a href="Home.html"> <img id="logo" src="imege/logo.png"></img> </a>
<nav>
<div class="topnav">
<a href="home.php">Home</a>
<a href="product.php">Products</a>
<a href="Contact.php">Contact</a>
<a href="about.php">About</a>
<a href="login.php">Sign</a>
</div>
</nav>
</header>
<div class="wrapper">
<div class="container">
<div class="">
<div class="col-sm-8 offset-sm-2 col-lg-6 offset-lg-3 col-xl-4 offset-xl-4 text-center">
<form action="" method="POST" class="rounded bg-white shadow p-5">
<div class="bg-warning">
<?php
$con = mysqli_connect("localhost","root","","projectweb");
if(isset($_POST['submit'])){
$email1 =$_POST['email'];
$query="select *from user where email='$email1'";
$result=mysqli_query($con,$query);
if(mysqli_num_rows($result) > 0){
while($row=mysqli_fetch_assoc($result)){
$fname = $row['fname'];
$lname = $row['lname'];
}
$fname1 =$_POST['fname'];
$lname1 =$_POST['lname'];
$password =$_POST['password'];
$confirm =$_POST['confirm'];
if( $fname1 == $fname){
if( $lname1 == $lname){
if($password==$confirm){
$query ="update user set password='$password' where email='$email1'";
$result = mysqli_query($con,$query);
if($result){
echo"Password is Change Now Sign in";
}
}
else{
echo"Password is Not Match";
header("Refresh:2");
}
}
else{
echo"Last name Wrong";
header("Refresh:2");
}
}
else{
echo"Frist Name Wrong";
header("Refresh:2");
}
}
else{
echo"Email is Not Registor";
header("Refresh:2");
}
}
?>
</div>
<div>
<h1 class="text-dark fw-bolder fs-4 mb-3">Change Your password</h1>
</div>
<div class="form-floating mb-3">
<input type="email" class="form-control" id="floatingInput" name="email" placeholder="name@example.com">
<label for="floatingInput">Email address</label>
</div>
<div class="form-floating mb-3">
<input type="text" class="form-control" name="fname" id="floatingfname" placeholder="">
<label for="floatingfname">Enter Your Frist Name</label>
</div>
<div class="form-floating mb-3">
<input type="text" class="form-control" name="lname" id="floatinglname" placeholder="">
<label for="floatinglname">Enter Your Last Name</label>
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="floatingPassword" name="password" placeholder="Password">
<label for="floatingPassword">New Password</label>
</div>
<div class="form-floating mb-3">
<input type="password" class="form-control" id="floatingPassword" name="confirm" placeholder="Password">
<label for="floatingPassword">Confirm Password</label>
</div>
<div>
<input type="submit" value="Change Now" name="submit" class="btn btn-primary submit_btn w-100 mb-3 ">
</div>
<div class="fw-normal text-muted mb-4">
Already Change? <a href="login.php" class="text-primay fw-bold text-decoration-none">Sign</a>
</div>
</form>
</div>
</div>
</div>
</div>
<footer class="sticky-footer topnav d-none d-sm-block ">
<div class="row ">
<div class="hopnav">
<a href="home.php">Care</a>
<a href="about.php">About</a>
<a href="#">+9231-1000999</a>
<a href="Contact.php">143-E Iqbal town</a>
</div>
</div>
<div style="clear: both;"><p class="text-center font-weight-light" style="color: #ddd;">copyright@ 2023</p></div>
</footer>
<!--Mobile screen-->
<footer class="sticky-footer topnav d-block d-sm-none ">
<div class="container">
<div class="row ">
<div class="mob-hopnav col-6 text-right">
<a href="home.php">Care</a>
</div>
<div class="col-6 text-left">
<a href="about.php">About</a>
</div>
<div class="row">
<div class="col-6 mob-hopnav d-inline text-light">
<p >+9231-1000999</p>
</div>
<div class="col-6 text-light">
<p >143E Iqbal town</p>
</div>
</div>
</div>
<div style="clear: both;"><p class="text-center font-weight-light" style="color: #ddd; font-size: 70%;">copyright@ 2023</p></div>
</div>
</footer>
</body>
</html>