-
Notifications
You must be signed in to change notification settings - Fork 4
/
reset-email-password.php
65 lines (60 loc) · 2.39 KB
/
reset-email-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
<?php
session_start();
require "config/config.php";
if (isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true) {
header("location: home.php");
exit;
}
if (empty($_GET['email']) || empty($_GET['code'])) {
header('location: login.php');
exit;
}
$email = $_GET['email'];
$code = $_GET['code'];
$string = "SELECT * FROM forgot_password WHERE email='$email' AND code='$code'";
$result = mysqli_query($link, $string);
if (mysqli_num_rows($result) == 0) {
header('location: login.php');
exit;
}
mysqli_close($link);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height">
<title>Reset password</title>
<link rel="shortcut icon" href="logos/logo.png" type="image/x-icon">
<link rel="stylesheet" href="css/general3.css?v=<?php echo time(); ?>">
</head>
<body>
<div class="wrapper">
<form action="actions.php?action=reset_email_password" method="post">
<div id="menu">
<h1>Reset your password</h1>
<input type="text" style="display: none" name='code' value="<?php echo $code; ?>">
<input type="text" style="display: none" name='email' value="<?php echo $email; ?>">
<div>
<input type="password" name="password" class="user-input" required placeholder="New password">
<br>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="confirm_password" required>
<label class="form-check-label" for="confirm_password">
Change my password.
</label>
</div>
<br>
<div>
<input type="submit" class="user-button" value="CHANGE PASSWORD">
</div>
<br>
<p>Remember password?</p>
<a href="login.php">Login now</a>
</div>
</form>
</div>
</body>
</html>