Mohron
New Member
- Messages
- 49
- Reaction score
- 0
- Points
- 0
Okay so I have a drop down menu on my site to change the theme. I have been working on a standards compliant template and when I moved the old dynamic drop down over, I just wouldn't work. I have since made some changes and restored functionality to FF3, Safari, & Opera. IE7 though, only half works (it doesn't bring you back to the originating page). The address for the page it's located is http://www.mohron.net/beta/
Here's the HTML
AND the PHP page
Now I have figured out that IE just treats the referer different then the other browsers in this instance and returns to the directory of the PHP file instead of the originating page.
I'm not sure how to fix this but basically I'm looking for a JS based fix because I've already tried sending the referer though the URL and I didn't like the results(worked but toke me to /index.php instead of / because of PHP $_PHP_SELF var).
Here's the HTML
HTML:
<form name="theme">
<select name="t" onchange="javascript:window.location.href=this.form.t.options[this.form.t.selectedIndex].value">
<option value="#" selected="selected">Theme Selection</option>
<option>------------------</option>
<option value="shared/php/settheme.php?t=blue">Blue (Default)</option>
<option value="shared/php/settheme.php?t=green">Green</option>
<option value="shared/php/settheme.php?t=orange">Orange</option>
<option value="shared/php/settheme.php?t=pink">Pink</option>
<option value="shared/php/settheme.php?t=red">Red</option>
</select>
</form>
PHP:
$theme=$_GET['t'];
$header="Location: ".$_SERVER['HTTP_REFERER'];
if (!isset($theme)){
if (isset($_SERVER['HTTP_REFERER'])){
header($header);
}
else {
header("Location: http://www.mohron.net/");
}
}
setcookie("some_cookie", "$theme", time()+3600*24*365, "/", ".example.com");
header($header);
I'm not sure how to fix this but basically I'm looking for a JS based fix because I've already tried sending the referer though the URL and I didn't like the results(worked but toke me to /index.php instead of / because of PHP $_PHP_SELF var).