GeoIP script problem

west13

Junior Member
Joined
May 31, 2012
Messages
173
Reaction score
64
I'm trying to use a geo ip script but I get this error:

Code:
[B]Fatal error[COLOR=#000000][FONT=Times New Roman]: [/FONT][/COLOR][/B][COLOR=#000000][FONT=Times New Roman]Cannot redeclare geoip_country_code_by_name() in[/FONT][/COLOR][B][B]/home/west13/public_html/geoip.inc[COLOR=#000000][FONT=Times New Roman] on line [/FONT][/COLOR][B]347

[/B][/B][/B]
I am sure is something from my host and I have to modify something but nothing I tried worked. Does anyone has some advice on how to make the script working..

I'm loking to redirect some cpa links based on country IP.
 
Hey,

Your problem is somewhere in your script you have already called out to function geoip_country_code_by_name().

Find out where the function is initially being called out and make the adjustments accordingly. You will have to figure this one out for yourself.
 
Last edited:
I'm really a noob on php. I actually tryed 3 different geoip script and none were working..I got different errors, thats why I think is somehow related to my host...maybe
 
You can try geoplugin. It's quite easy to use. Example.

$country = unserialize(file_get_contents('GEOPLUGIN LINK/php.gp?ip='.$_SERVER['REMOTE_ADDR']));
$userCountry = $country['geoplugin_countryName'];

This will give you full country name, if you want only country code just replace geoplugin_countryName with geoplugin_countryCode.

Note: I'm not allowed to post links, replace 'GEOPLUGIN LINK' with valid url.
 
You probably include the same file twice that have same function name and thats why you are getting the error.. definitely it is not a host issue
 
I fixed it.... http://code.google.com/p/slimstat/issues/detail?id=1

I had to change some code..The thing is that I found a fix on another site but I think a { was missing and got another error so that's why I was puzzled...But works now and I think this fix might help others...
 
Geoplugin?! Never heard of it. Will check it out as maxmind's is kinda glitchy at times
 
Back
Top