Код: Выделить всё
$ip = $_SERVER['REMOTE_ADDR'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (!is_bot($user_agent, $bots)) {
$access_key = '6adf16bff8db66'; // Replace with your ipinfo.io access key
$ch = curl_init('http://ipinfo.io/' . $ip . '?token=' . $access_key);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);
$ip_details = json_decode($json, true);
if ($ip_details['country'] == 'TH') {
header('Location: https://example.com/');
exit;
}
}
пожалуйста, помогите
Подробнее здесь: https://stackoverflow.com/questions/792 ... ic-country