Hey all,
Anyone know how I can get the country name or code for a referer using php?
I wrote the following code to get the country name where a referer is from, but I keep getting a FATAL ERROR.
// get country name location of host
$refer = parse_url($_SERVER['HTTP_REFERER']);
$host = $refer['host'];
$loc = geoip_country_code_by_name($host);
I'm using this code for both PHP 4 & 5, but am having no luck.
Any help is greatly appreciated. Thanks!
- tyhand
Anyone know how I can get the country name or code for a referer using php?
I wrote the following code to get the country name where a referer is from, but I keep getting a FATAL ERROR.
// get country name location of host
$refer = parse_url($_SERVER['HTTP_REFERER']);
$host = $refer['host'];
$loc = geoip_country_code_by_name($host);
I'm using this code for both PHP 4 & 5, but am having no luck.
Any help is greatly appreciated. Thanks!
- tyhand