runQuery("SELECT * FROM account WHERE acc_no=? AND upass=?"); $stmt->execute([$acc_no, $upass]); $row = $stmt->fetch(PDO::FETCH_ASSOC); if ($stmt->rowCount() == 1 && in_array($row['status'], ['Active', ''])) { $_SESSION['acc_no'] = $acc_no; // Generate & store OTP $code = substr(str_shuffle("0123456789"), 0, 6); $reg_user->runQuery("UPDATE account SET tmp_otp=? WHERE acc_no=?")->execute([$code, $acc_no]); // Send OTP Email $subject = "Your Secure Login Code"; $message = "

Your One-Time Passcode

Hello {$row['fname']},

$code

This code expires in 10 minutes.

"; $reg_user->send_mail($row['email'], $message, $subject); // Redirect based on phone_verify if ($row['phone_verify'] == 1) { header("Location: board.php"); } else { header("Location: verify_otp.php"); } exit(); } else { $msg = "
Incorrect surname or passcode. Please check your details and try again.
"; } } ?> Log in to Online Banking | Wells Capital Corporation
Wells Capital Corporation