i have a reset pw po here and gusto ko sana mavalidate din yong security ques and answer bago magsend ng otp, patulog naman po.
paayos naman po code.
patulooooooong po pls
paayos naman po code.
Code:
//if user click continue button in forgot password form
if(isset($_POST['check-email'])){
$email = mysqli_real_escape_string($conn, $_POST['email']);
$check_email = "SELECT * FROM users WHERE email='$email'";
$run_sql = mysqli_query($conn, $check_email);
if(mysqli_num_rows($run_sql) > 0){
$code = rand(999999, 111111);
$insert_code = "UPDATE users SET code = $code WHERE email = '$email'";
$run_query = mysqli_query($conn, $insert_code);
if($run_query){
$subject = "Complete your password reset request";
$message = "
Hi $email,
Your password reset code is $code
If you did not ask to reset your password ignore this message.
With regrads,
The Kamote Team";
$sender = "From: my_gmail@gmail.com";
if(mail($email, $subject, $message, $sender)){
$info = "We've sent a password reset otp to your email - <b> $email </b>, Check your spam or junk folder if you don’t see the email in your inbox";
$_SESSION['info'] = $info;
$_SESSION['email'] = $email;
header('location: reset-code.php');
exit();
}else{
$errors['otp-error'] = "Failed while sending code!";
}
}else{
$errors['db-error'] = "Something went wrong!";
}
}else{
$errors['email'] = "This email address does not exist!";
}
}
patulooooooong po pls
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.
Last edited: