Is it possible to have 2 index's, one for the USA and one for the UK for example. Depending on where you are from, depends on what page loads (This is because i am selling something and don't want to alienate the uk audience by having everything in $$'s I am guessing it would be some sort of javascript or php which would load. I suppose i could just have the prices change rather than the whole site? Any help will be most appreciated and repped
Something like this could work in your main file. <? /* If your hosting supports it'll use file_get_contents otherwise uses a custom script using CURL */ function fetch_url($url) { if (!function_exists('file_get_contents')) return file_get_contents_curl($url); else return file_get_contents($url); } function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $data = curl_exec($ch); curl_close($ch); return $data; } $fetch = unserialize(fetch_url('http://www.geoplugin.net/php.gp?ip='.$_SERVER['REMOTE_ADDR'])); $geo_code = $fetch['geoplugin_countryCode']; if(file_exists($geo_code.'.php')) include($geo_code.".php"); //includes the php file matching the country code us.php ca.php etc else include("notfound.php"); // if you don't have a page created for that specific country yet ?> PHP: Course instead of loading entire pages you could actually change that if-then-else block to load your price settings and other arrays and use that block of code above in the header of your main site. And the else part could be defaults.php to load a default set of info for countries not defined. Meaning you could do something like this if your main country is US. gb.php <? $exchange_rate = 0.60318; // would be zero in us.php setlocale(LC_MONETARY, 'en_GB'); //below would be how you can automatically format the currency output appropiate to the country. //$fmt = 'The final value is %i (after a 10%% discount)'; //echo money_format($fmt, 1234.56) . "\n"; ?> PHP: Basically if all your prices in the database are US Dollars, you can multiply it by the exchange rate loaded via the custom include. Course you'd have to update the rate every so often.