Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/125153-ie6-and-this-code-headache/
Share on other sites

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.....

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.