How Do I display a different page based on visitors IP?

canucksfan19

New member
Jun 20, 2009
390
6
0
Kelowna, BC
Hey guys,

So I need to do either of these:

1) show a different site ( same site but different affiliate link for specific country) US, UK, CND

2) is there a way I can read the IP and have it just display a different aff link depending on what country the IP is from?

I found this:

Code:
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">

var country = geoip_country_code();

switch (country)
{
case (country = "US"):
  window.location = "YOUR US OFFER";
break;
case (country = "UK"):
  window.location = "YOUR UK OFFER";
break;
default:
  window.location = "YOUR INTERNATIONAL OFFER";
break;
}
</script>

Any other ideas? or whats wrong with this code?

Will this load fast enough?

Thanks,