I use the Perl Binary;
Code:
#!/usr/bin/perl
####################################
#geo_ip_no.cgi
#Specific geo target
#
#
#
#
####################################
use CGI::Carp qw/fatalsToBrowser/;
use CGI qw/:standard/;
$addr ="$ENV{'REMOTE_ADDR'}";
$browser = $ENV{'HTTP_USER_AGENT'};
$geoip_file = "/usr/share/geo_ip/GeoIP.dat";
print "Content-type: text/html\n\n";
$qstring = "$ENV{'QUERY_STRING'}";
if ($qstring =~ s/[^a-zA-Z0-9\_]//g) {print qq~HUH???~; exit;}
use Geo::IP;
$gi = Geo::IP->open( $geoip_file, GEOIP_STANDARD)||die"died opening";
$country_code = $gi->country_code_by_addr($addr);
if ($country_code !~/(AA|BB|CC|DD|EE)/i){
#INSERT
}#end geo ip
else{
exit;
}
Similar variables to the PHP maybe you can see why you are getting that error?