Just make the link on each flags set a querystring variable for each currency, IE: http://www.yoursite.com/index.php?currency=eur
Then:
PHP Code:
<?php
session_start();
$supported_currencies = array('USD', 'EUR', 'GBP');
if ((isset($_GET['currency'])) && ($_GET['currency'] != '')
&& (array_search(strtoupper($_GET['currency']), $supported_currencies) !== false)) {
$_SESSION['currency'] = strtoupper($_GET['currency']);
} else {
$_SESSION['currency'] = 'USD'; // Set a default
}
// Then, later on if you want to grab the selected currency
echo "The current currency is: {$_SESSION['currency']}";
?>
Bookmarks