location.href="forgot_pass.php"'; } else { $_SESSION['pass_otp'] = 0; echo ''; } } ?> Admin | Log in

Forgot Password

query("SELECT * FROM login where email = '".$_POST['email']."'"); if($check->num_rows) { $db = $check->fetch_assoc(); $_SESSION['pass']['center_id'] = $db['id']; $_SESSION['otp'] = rand(1111,9999); $to = $db['email']; $subject = 'Forgot Password'; $from = 'noreply@'.$_SERVER['HTTP_HOST']; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Create email headers $headers .= 'From: '.$from."\r\n". 'Reply-To: '.$from."\r\n" . 'X-Mailer: PHP/' . phpversion(); // Compose a simple HTML email message $message = ''; $message .= '

Hi Dear!

'; $message .= '

Your Password Forgetten key is '.$_SESSION['otp'].'

'; $message .= ''; // echo $message; // Sending email if(mail($to, $subject, $message, $headers)){ echo 'Your mail has been sent successfully.'; } else{ echo 'Unable to send email. Please try again.'; } echo $_SESSION['otp']; ?>
alert("E-Mail not matched!!");location.href="forgot.php"'; } ?>
Login here