How to change your page depend of the country. <?php // changes yourpage.php for the correct file according to the country if (isset( $country ) && ( $country <> †)) { $dgo_country = substr ( $country , 0 , 5 ); } else { $dgo_country = substr ( $_SERVER [ "HTTP_ACCEPT_LANGUAGE" ], 0 , 5 ); } switch ( $dgo_country ) { case “us-mx†: //if mx include( “yourpage.php†); break; case “us-ar†: //if arg include( “yourpage.php†); break; case “us-cl†: //if ch include( “yourpage.php†); break; case “us-ve†: //if vz include( “yourpage.php†); break; case “pt-br†: //if br include( “yourpage.php†); break; case “us-co†: //if co include( “yourpage.php†); break; case “us-ec†: //if ec include( “yourpage.php†); break; case “us-uy†: //if uy include( “yourpage.php†); break; default: //if other country include( “yourpage.php†); break; } ?> PHP:
Use the IP2Country class, more accurate than reading language headers.... http://phpweby.com/software/ip2country
Create 2 different tables in your datbase, one for country name and other for ip addresses. Use a loop to fetch both data and check country's ip by if statement, thus all checks are automated, you don't need to check 290 countries manually. If the process delays, you can call Ajax function while page loads.