OTP for login
Dear customer,
use this One Time Password - " . $otp . " to log in to your account. This OTP will be valid for the next 5 mins.";
$row = mysqli_fetch_assoc($result);
$response = array(
'status' => 'true',
);
echo json_encode($response);
send_mail($offiial_email_id, "Otp for login", $massage, '');
} else {
// Error executing SQL query
echo json_encode(['status' => 'false', 'message' => 'Email does not exist']);
error_log("Dushan jhsj");
}
} else {
$sqlinsert = "INSERT INTO `email_otp`(`email_id`, `otp`, `expiry`) VALUES ('$offiial_email_id', '$otp', '$expiry')";
error_log("API LOGIN : " . $sqlinsert);
if (mysqli_query($conn, $sqlinsert)) {
$massage = "";
$massage .= "