L
L
l2p2014-10-17 15:33:49
PHP
l2p, 2014-10-17 15:33:49

How to make geotargeting for only one country?

It is necessary for users from Ukraine to show other content. Without division into cities and only Ukraine, the rest - show the main site.
How to implement this with PHP? Maybe somewhere there is a database of subnets only in Ukraine or are there any other methods?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Grechushnikov, 2014-10-17
@maxyc_webber

sypex geo if you don't want or can't mess with Apache

M
mikka, 2014-10-17
@mikka

There is mod_geoip for Apache. The module will expose an environment variable available in PHP.

D
dostelon, 2014-10-29
@dostelon

tabgeo.com

include("tabgeo_country_v4.php");
$ip = $_SERVER['REMOTE_ADDR'];
$country_code = tabgeo_country_v4($ip);
if($country_code == 'UA'){
//Украина
}else{
//Другие страны
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question