sKunKbad Posted September 21, 2008 Share Posted September 21, 2008 I have been working on a CSS theme changer, which is done using mod_rewrite and a redirect. All is well in most of the browsers I have tried (FF2, IE7, Opera, Safari), but IE6 doesn't like it. I do admit, I am running a standalone IE6, so that could be the reason. I don't actually have access to a real installation of IE6, so it may not be a problem for "normal" IE6 users. Perhaps you could check it for me if you have a real installation of IE6. First the rewrite rule (which is fairly normal): rewriteRule ^style.css$ http://www.brianswebdesign.com/style.php [NC,L] So when each page is looking for a stylesheet, they are actually being fed /style.php: <?php session_start(); $rose_theme = "rose_theme.css"; $blue_theme = "blue_theme.css"; if(isset($_SESSION['stylesheet'])){ $choice = htmlspecialchars($_SESSION['stylesheet']); $styleChoice = $$choice; }else{ $styleChoice = $rose_theme; } $style = file_get_contents($styleChoice); header("Content-Type: text/css"); echo $style; ?> There is a simple form associated with the user being able to pick the theme: <form method="post" action="themeChanger.php"> <select id="theme_choice" name="theme_choice"> <option value="blue_theme">Blue</option> <option value="rose_theme">Rose Garden</option> </select> <input type="submit" value="Change Theme" /> </form> and then there is themeChanger.php, which is a redirect script: <?php session_start(); if(isset($_SERVER['HTTP_REFERER'])){ $samePage = htmlspecialchars($_SERVER['HTTP_REFERER']); }else{ $samePage = 'http://www.brianswebdesign.com'; } $theme = filter_input(INPUT_POST, 'theme_choice' , FILTER_SANITIZE_STRING ); if ($theme == FALSE || $theme == NULL){ $_SESSION[stylesheet] = 'rose_theme'; }else{ $_SESSION[stylesheet] = htmlspecialchars($_POST[theme_choice]); } header("Location: $samePage"); ?> For some reason, IE6 just hangs when I test this on the production server. On my home computer, IE6 does fine. Any hints as to what might be wrong is appreciated. I'm also wondering if I am protecting myself correctly in terms of $_POST, $_SERVER, and $_SESSION variables. Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/ Share on other sites More sharing options...
redarrow Posted September 21, 2008 Share Posted September 21, 2008 to be onest ie6 is crap so not worth cheeking........... according to the big boys in the sky use as little css or as simple for ie6............... IT MIGHT HANG IN IE6 BUT REMEMBER IE6 WAS FULL OFF BUGS THERE HUNDREDS OF IE6 VERSIONS DEFENTLY TO DO WITH CSS TRUST ME..... Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/#findComment-646876 Share on other sites More sharing options...
sKunKbad Posted September 21, 2008 Author Share Posted September 21, 2008 Yeah, I hate IE6 too, but if it were a simple fix I'd feel better about fixing it. The whole rest of the site looks normal and works in IE6. Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/#findComment-646882 Share on other sites More sharing options...
redarrow Posted September 21, 2008 Share Posted September 21, 2008 look it a huge story on it own, Post you css for the templates were have a look no promise......... Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/#findComment-646888 Share on other sites More sharing options...
sKunKbad Posted September 21, 2008 Author Share Posted September 21, 2008 While it may be a header issue for the incoming CSS file, there's no way the CSS itself has a problem. It validates perfectly. The XHTML also validates perfectly. CSS -- http://www.brianswebdesign.com/style.css Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/#findComment-646893 Share on other sites More sharing options...
chronister Posted September 21, 2008 Share Posted September 21, 2008 It may be that your modifying it right now, but it does not change themes in FF3 or in IE6 Nate Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/#findComment-646896 Share on other sites More sharing options...
sKunKbad Posted September 21, 2008 Author Share Posted September 21, 2008 Yes, I have been working on it. It's working in my Mac FF3, but I haven't tried Win FF3 yet. Thanks for the heads up though. Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/#findComment-646907 Share on other sites More sharing options...
sKunKbad Posted September 21, 2008 Author Share Posted September 21, 2008 Well, I changed the fact that the stylesheet was being generated through php, and it's working for me in IE6. Quote Link to comment https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/#findComment-646927 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.