( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/../tmpr/../tmpr/../tmpr/../geoip/block.php
eeeeeeeeeeeeeeeee
<?php
require 'vendor/autoload.php';

use GeoIp2\Database\Reader;

// Define the country codes you want to block
$blocked_countries = ['CN', 'KE']; // Example: Block China and Russia

// Path to the MaxMind GeoLite2-Country database
$databaseFile = 'GeoLite2-Country.mmdb';

// Get the visitor's IP address
$ip_address = $_SERVER['REMOTE_ADDR'];

try {
    $reader = new Reader($databaseFile);
    $record = $reader->country($ip_address);
echo    $country_code = $record->country->isoCode;

    if (in_array($country_code, $blocked_countries)) {
        // If the country code is in the blocked list, deny access
        header('HTTP/1.1 403 Forbidden');
        echo "Access denied.";
        exit;
    }
} catch (Exception $e) {
    // Handle errors if the IP address is not found in the database
    error_log($e->getMessage());
}

// The rest of your application code goes here

?>