PHP, sql

Password Recovery via Email

<form action=”” method=”POST”>
<label>Your E-Mail Address</label><input type=”email” name=”email” required><br/>
<input type=”submit” name=”submit” value=”SEND YOUR PASSWORD”>
</form>

<?php
require_once(“connect.php”);
$email = $_POST[“email”];
$numQuery = “SELECT * FROM puran WHERE email=’$email'”;
$runNameQuery = mysqli_query($connect,$numQuery);
while($getRow = mysqli_fetch_array($runNameQuery)){
if($runNameQuery==true) {
$to = $email;
$subject = “Password Recovery”;
$msg = “Hi! “.$getRow[‘name’].”. Your Mail: “.$getRow[’email’].”, Your Password: “.$getRow[‘password’];
$msg = wordwrap($msg,70);
$headers = “From: admin@hostickbd.com”;
if(mail($to, $subject, $msg, $headers)){
echo “Hi! “.$getRow[‘name’].”, Password sent to your email. Please Check your Email.”;
}}}?>

Leave a Reply