-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforgot-password.php
87 lines (63 loc) · 1.91 KB
/
forgot-password.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
<?php
$title = "Forgot Password";
include 'includes/header.php';
?>
<body id="top">
<div id="preloader">
<div id="loader" class="dots-fade">
<div></div>
<div></div>
<div></div>
</div>
</div>
<?php
include 'includes/navbar.php';
?>
<section class="s-content s-content--top-padding">
<div class="row">
<div class="col-full s-content__main">
<div class="row narrow">
<div class="col-full s-content__header" data-aos="fade-up">
<h1 class="display-1 display-1--with-line-sep">Change Password</h1>
</div>
</div>
<div class="row entries-wrap add-top-padding wide">
<form method="post" role="form" class="form">
<div class="form-group">
<label>Email</label>
<input type="email" name="email" class="full-width" placeholder="E-Mail" class="form-control">
</div>
<div class="form-group">
<label>New Password</label>
<input type="password" name="password" class="full-width" placeholder="Password" class="form-control">
</div>
<div class="form-group">
<input type="submit" name="submit" value="Login" class="submit btn btn--primary btn--large full-width">
</div>
</form>
<div align="center">
<b><a href="forgot-password.php?step1=1">Forgot Password</a></b>
</div>
</div> <!-- s-content__main -->
</div> <!-- end row -->
</section>
<?php
include 'includes/footer.php';
include 'includes/scripts.php';
?>
<?php
global $connection;
if (isset($_POST['submit'])) {
$pwd = $_POST['password'];
$rehashpwd = md5($pwd);
if(mysqli_query($connection, "UPDATE user SET U_password='$rehashpwd' WHERE U_email='$_POST[email]'")){
?>
<script type="text/javascript">
alert("password has been changed");
</script>
<?php
}
}
?>
</body>
</html>