I have a commerce site I am just about to finish but I have one nagging issue that I am having trouble tracking down. The site allows the user to choose either $US or $CAN currency and each of the pages relative to the currency are in their own subdirectory. Then, there are some common pages that I did not want to duplicate in each of the subdirs so they are in the root. I needed a way to track which currency the user had chosen so that when the user went to one of these root pages, we would know which currency subdir they had come from and could take them back there when they were ready. I chose to do this with $_SESSION vars and for all intents and purposes it works great. At least on all PC/browsers and most Macs/browsers except for Macs with OSX and running IE 5.23 or Safari Version 1.xxx The othjer twist is that the navigation is contained in a small flash navigation movie that calls a nav.php script and passes a var to it via $_POST that contains the page link to where the user wants to go minus the value of the $_SESSION var which is prepended to this link value to create the entire url.
Here is the nav.php script:
Code: Select all
<?php
session_start();
switch ($_GETї'mode']) {
case choose:
if ($_POSTї'us_x']) {
$curPath = "us";
//echo $curPath . "<br>";
} elseif ($_POSTї'canada_x']) {
$curPath = "canada";
//echo $curPath . "<br>";
} else {
die("Path not set!!");
}
if ($curPath) {
$_SESSIONї'path'] = $curPath;
//echo $_SESSIONї'path'] . "<br>";
} else {
die ("Path not set!!");
}
if (isset($_SESSIONї'path']) && $_SESSIONї'path'] == "canada") {
header("Location: " . $_SESSIONї'path'] . $_POSTї'linkpage'] . "");
} else {
header ("Location: " . $_SESSIONї'path'] . $_POSTї'linkpage'] . "");
}
break;
case change:
unset($_SESSIONї'path']);
header("Location: /index.php");
break;
case root:
header("Location: " . $_SESSIONї'path'] . $_POSTї'linkpage'] . "");
break;
case rockitwear:
header("Location: " . $_SESSIONї'path'] . "/rockitwear.php");
}
?>Code: Select all
on (press) {
var
c = new LoadVars();
c.linkpage = "/school_grp.php";
c.send("http://roarockit.zuka.net/nav.php?mode=root","_self","POST");
}Sorry about this long assed ramble but this is a bit hard to explain.
Any thoughts would be appreciated.
Cheers
Dave