Page 1 of 1
Page redirection according to IP
Posted: Fri 13. Aug 2004, 18:33
by b.r bruss
Is it possible to redirect a visitor to a certain summary or page according to their IP ? (country)
French IP to french summary or page
Any other IP : english site
Thanks ;o)
Posted: Tue 17. Aug 2004, 11:58
by usa
Yes is possible!
Requirements:
None (only the 'GeoIP.dat' file is needed). To download a free GeoIP Standard Country
database, go to
http://maxmind.com/download/geoip/database/
Install
Just place the 'geoip.inc' file somewhere according to the 'include_path' directive of
your 'php.ini' file.
Usage
Gets country name by hostname :
include("geoip.inc");
$gi = geoip_open("/usr/local/share/GeoIP/GeoIP.dat",GEOIP_STANDARD);
echo geoip_country_code_by_addr($gi, "24.24.24.24") . "\t" .
geoip_country_name_by_addr($gi, "24.24.24.24") . "\n";
echo geoip_country_code_by_addr($gi, "80.24.24.24") . "\t" .
geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";
geoip_close($gi);
Posted: Wed 18. Aug 2004, 04:03
by b.r bruss
thanks a lot
i didn't knew about your answer
the "notify me..." option is not working i guess
I will check it out
your answer is very clear
once again thanks