-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdp_oublie2.php
49 lines (41 loc) · 1.33 KB
/
mdp_oublie2.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
<?php require_once("config.php");
require_once('PHPMailer/class.phpmailer.php');
$email=$_POST['email'];
$user_mail = $bdd -> prepare("SELECT email, clefCompte FROM membres WHERE email = '$email'");
$user_mail -> execute();
$user= $user_mail -> fetch();
$clefCompte=$user['clefCompte'];
if (isset($user['email'])&&!empty($user['email'])) {
$mail = new PHPMailer();
$mail->IsHTML(true);
$mail->CharSet = "utf-8";
$mail->From = 'contact@hsh.com';
$mail->FromName = 'Home Switch Home';
$mail->Subject = 'Votre mot de passe sur Home Switch Home';
$mail->Body =
'Bonjour , <br/>
Vous venez de faire une demande de mot de passe oublié sur Home Switch Home. Afin de réinitialiser votre mot de passe, veuillez cliquer sur le lien suivant :
<a href="http://localhost:8888/Version10/reset-mdp.php?mail='.$email.'&clefCompte='.$clefCompte.'">réinitialiser votre mot de passe</a>
';
$mail->AddAddress($email);
$mail->Send();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Home Switch Home</title>
<link href="style.css" rel="stylesheet" />
</head>
<body>
<div id="wrapper">
<?php include("header.php"); ?>
<div id="user_list">
<h3>Veuillez cliquer sur le lien recu par mail.</h3>
</div>
<div id="footer">
<?php include("footer.php"); ?>
</div>
</body>
</html>