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
|
<?php
$server='localhost';
$login='root';
$mdp_sql_pass='vertrigo';
$dbname='drp';
if(isset($_POST['send'])){
$pdo = new PDO(mysql:host=$server,dbname=$table,$login,$mdp_sql_pass);
$forget = $pdo->prepare("SELECT `username`,`password` FROM `users` WHERE `email` = :email LIMIT 1");
$forget-> execute(array(
"email" => $_POST['email']
));
$dnn = $forget->fetchObject();
$password = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5(key_encrypt), base64_decode($dnn->password), MCRYPT_MODE_CBC, md5(md5(key_encrypt))));
$message = "Identifiants :<br><br>
Pseudo : ".$dnn->pseudo."
<br>Mot de passe : ".$password;
$headers = "From: ".company_name."<".company_mail.">\n";
$headers .= "Reply-To: ".company_mail."\n";
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"";
mail($_POST['mail'],"Identifiants [".company_name."]",$message,$headers);
redirect('index.php');
}
?> |
Partager