Advertisement
Guest User

Untitled

a guest
Nov 8th, 2012
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. <?php
  2.  
  3. include("geoip.inc");
  4. $ip=$_SERVER['REMOTE_ADDR'];
  5. $gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);
  6.  
  7. $country_code = geoip_country_code_by_addr($gi, "$ip");
  8.  
  9. // Country name is not used so commented
  10. // Get Country Name based on source IP
  11. //$country = geoip_country_name_by_addr($gi, "$ip");
  12.  
  13. geoip_close($gi);
  14.  
  15. switch($country_code)
  16.  
  17.     {
  18.         case "US": header("Location: http://afflink1.com"); break;
  19.         case "CA": header("Location: http://afflink2.com"); break;
  20.         case "AU": header("Location: http://afflink3.com"); break;
  21.     case "GB": header("Location: http://afflink4.com"); break;
  22.     case "FR": header("Location: http://afflink5.com"); break;
  23.     case "DE": header("Location: http://afflink6.com"); break;
  24.     case "SE": header("Location: http://afflink7.com"); break;
  25.     case "TH": header("Location: http://afflink8.com"); break;
  26.     case "IN": header("Location: http://afflink9.com"); break;
  27.         default: header("Location: http://internationaloffer.com");
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement