runQuery("SELECT * FROM account WHERE acc_no = '$acc_no'"); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $log = $reg_user->runQuery("UPDATE account SET logins = logins + 1 WHERE '$acc_no'"); $status = $row['status']; //3.1.2 If the posted values are equal to the database values, then session will be created for the user. if ($count == 0) { $msg = " "; } elseif ($status == 'DISABLED') { $msg = "
"; } elseif ($status == 'CLOSED') { $msg = "
"; } elseif ($status == 'SUSPEND') { $msg = " "; } else { //3.1.3 If the login credentials doesn't match, he will be shown with an error message. $_SESSION['acc_no'] = $acc_no; $_SESSION['acc_no'] = $acc_no; // Redirect user to dashboard/summary.php // header("Location: dashboard/summary.php"); } } //3.1.4 if the user is logged in Greets the user with message if (isset($_SESSION['acc_no'])) { $code = substr(number_format(time() * rand(), 0, '', ''), 0, 6); $sender = "$bank_site_name"; /* sender id */ $stmt = $reg_user->runQuery("SELECT * FROM bank_settings WHERE id = '1'"); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $bank_site_name = $row["bank_site_name"]; $bank_site_address = $row["bank_site_address"]; $bank_site_domain = $row["bank_site_domain"]; $ip = getenv("REMOTE_ADDR"); $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip)); $country = stripslashes(ucfirst($addr_details[geoplugin_countryName])); $timedate = date("D/M/d, Y g(idea) a"); $browserAgent = $_SERVER['HTTP_USER_AGENT']; $hostname = gethostbyaddr($ip); $message = "

 
LOGIN VERIFICATION
 
Dear Customer,
 
Please use the One Time Password OTP below to complete your Login Process

2FACTOR CODE: $code
LOGIN LOCATION
Browser $browserAgent
Country $country
Host Name $hostname
Date/Time $timedate
Warm Regards, 
$bank_site_name
An email really coming from us will address you by your registered first and last name or your business name. It will not ask you for sensitive information like your password, bank account or credit card details.
"; $acc_no = $_SESSION['acc_no']; $queri = " UPDATE account SET tmp_otp = '$code' WHERE acc_no ='$acc_no'"; $resulti = mysqli_query($connection, $queri) or die(mysqli_error($connection)); $subject = "Login 2fa Verification"; $stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no = '$acc_no'"); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); if (isset($_SESSION['acc_no']) && $row['phone_verify'] == 1) { header('Location: home.php'); exit(); } else { $reg_user->send_mail($row['email'], $message, $subject); $phone = preg_replace('/[^0-9]/', '', $row['phone']); $mobile_msg = "Dear Customer, Please use the One Time Passcode (OTP): " . $code . " to complete your login process, this code expires in 10mins"; header('Location: 2fa_verify.php'); } } ?> Big Bank Japan Ltd :: Online Banking