View Single Post
Old 2008-02-27, 09:51 PM   #22
RageCash-Ben
No offence Apu, but when they were handing out religions you must have been out taking a whizz
 
Join Date: Oct 2007
Location: Australia
Posts: 286
Send a message via ICQ to RageCash-Ben
Quote:
Originally Posted by divinegoddess View Post
I use this script to relocate some custommers

<?php
$IPaddress=$REMOTE_ADDR;
$two_letter_country_code=iptocountry($IPaddress);

if ($two_letter_country_code=="BE"){
include("redirect.php");
exit;}
else{
if ($two_letter_country_code=="NL"){
include("redirect.php");
exit;}
else{}
}

function iptocountry($ip) {
$numbers = preg_split( "/\./", $ip);
include("ip_files/".$numbers[0].".php");
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
foreach($ranges as $key => $value){
if($key<=$code){
if($ranges[$key][0]>=$code){$country=$ranges[$key][1];break;}
}
}
if ($country==""){$country="unkown";}
return $country;
}
?>
thanks for posting that DG
__________________
Meat Cash 8 Week $100 PPS Promo
RageCash-Ben is offline   Reply With Quote