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”>

$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:”;
if(mail($to, $subject, $msg, $headers)){
echo “Hi! “.$getRow[‘name’].”, Password sent to your email. Please Check your Email.”;

Leave a Reply

Your email address will not be published. Required fields are marked *