-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforgot_password.php
executable file
·123 lines (108 loc) · 4.47 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Camagru - Forgot Password</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="stylesheets/sign_in.css" />
<link rel="shortcut icon" type="image/png" sizes="16x16" href="images/Ukulily.png" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" />
</head>
<body>
<div id="top">
<header>
<a href="home_page.php"><img src="images/Ukulily.png" id="ukulily_logo" alt="Ukulily Logo" title="Ukulily Logo" /></a><h1>Camagru</h1>
</header>
<nav id="nav_bar">
<ul id="nav_list">
<li><a href="home_page.php">HOME</a></li>
<li><a href="gallery.php">GALLERY</a></li>
<li><a href="sign_up.php">SIGN UP</a></li>
<li><a href="index.php">SIGN IN</a></li>
</ul>
</nav>
</div>
<br>
<div id="mid_div">
<h2 id="sign_in">FORGOT PASSWORD</h2>
</div>
<div>
<form action="forgot_password.php" method="POST">
<table>
<tr>
<td class="text">
Username:
</td>
<td>
<input type="text" id="username" name="username" class="inputs" />
</td>
</tr>
<tr>
<td class="text">
Email Address:
</td>
<td>
<input type="email" name="email" placeholder="email@domain.com" class="inputs" />
</td>
</tr>
<tr><td><br/></td></tr>
<tr>
<td colspan="2">
<button type="submit" id="submit" name="submit">Submit</button>
</td>
</tr>
</table>
</form>
</div>
<div id="footer">
<footer class="w3-container w3-padding-64 w3-center w3-black w3-xlarge">
<a href="https://www.facebook.com/UkulilyFilly" target="_blank"><i class="fa fa-facebook-square" style="font-size: 40px; color: #8625FB;"></i></a>
<a href="https://twitter.com/UkulilyFilly" target="_blank"><i class="fa fa-twitter-square" style="font-size: 40px; color: #8625FB;"></i></a>
<a href="https://www.linkedin.com/in/miriam-lamarre" target="_blank"><i class="fa fa-linkedin-square" style="font-size: 40px; color: #8625FB;"></i></a>
<p style="font-size: 0.8vw">Fictional Website created by mlamarre of <a href="http://www.wethinkcode.co.za/" target="_blank" >WeThinkCode_</a></p>
<p style="font-size: 0.7vw">Copyright © 2016</p>
</footer>
</div>
<div>
<!-- <?php
include ('./config.php');
$username = $_POST['username'];
$email = $_POST['email'];
$connection = new PDO($DB_DSN, $DB_USER, $DB_PASS, $DB_PDO);
$select_username = $connection->query("SELECT USERNAME FROM users WHERE USERNAME like '$username'");
$select_email = $connection->query("SELECT EMAIL FROM users WHERE USERNAME like '$username'");
$select_password = $connection->query("SELECT PASSWORD FROM users WHERE USERNAME like '$username'");
if (isset($username) && isset($email) && !empty($username) && !empty($email)) {
foreach ($select_username as $user_row) {
if ($user_row['USERNAME'] == $username) {
foreach ($select_email as $email_row) {
if ($email_row['EMAIL'] == $email) {
foreach ($select_password as $password_row) {
$password = $password_row['PASSWORD'];
$email_subject = "Camagru | Password Change Request";
$email_head = "From: noreply@camagru.42.fr"."\r\n";
$email_message = "
Good Day ".$username.",
Please note that a change of password request has been sent to you:
----------------------------------------------------
EMAIL ADDRESS: ".$email."
----------------------------------------------------
You can click on the link below to make the change:
http://localhost:8080/files/change_password.php?change_log=$password
Thank you for your continued use,
Camagru Team";
mail($email, $email_subject, $email_message, $email_head);
echo "<div id='invalid1'>An email has been sent to your email <span id='email'>$email</span> <br />
You will be able to change your password by clicking the verification link.</div><br />";
}
}
}
}
}
}
else if (isset($username) && isset($email) && (empty($username) || empty($email))) {
echo "<div id='invalid1'>Please enter a Username and an Email Address</div>";
}
?>
</div> -->
</body>
</html>