Ok I got it working. I looked up how OSCommerce does this. Essentially, I think my logic is right, just pass all the hidden variables around. Hopefully, this helps someone else who has a similar problem.
Here's my final code:
//Currency Change
if (isset($_REQUEST['currency']))
$_SESSION['currency'] = $_REQUEST['currency'];
//Default currency
if (!isset($_SESSION['currency']))
$_SESSION['currency'] = 1;
//Go to the right place in the dropdown
if ($_SESSION['currency']==1)
$USD = "SELECTED";
else $CAD = "SELECTED";
//Attach all the hidden request variables to the URL
$URL = $_SERVER['PHP_SELF'];
$hidden_request_variables = '';
foreach ($_REQUEST as $k => $v) {
//Exclude currency since it may change
if ( ($k != 'currency') && ($k != sessionID) && ($k != 'PHPSESSID') ) {
$hidden_request_variables .= "$k=$v&";
}
}
$URL .= "?{$hidden_request_variables}";
//Remove the last character either & or ?
$URL = substr($URL, 0, -1);
<form method=post action="<?=$URL?>">
<select name=currency onchange="form.submit();">
<option value=1 <?=$USD?>>U.S. Dollar</option>
<option value=2 <?=$CAD?>>Canadian Dollar</option>
</select>
</form>