View Single Post
Old 11-16-2010, 06:32 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
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?
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote