Re: Newbie NN4 help...
| From: | @ Edwin | Date: | Sun, 20 Oct 2002 04:04:24 +0000 |
| Subject: | Re: Newbie NN4 help... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120656@lists.php.net to get a copy of this message | ||
Hello,
On Sunday, October 20, 2002 7:13 AM
Stephanie Sullivan wrote:
...[snip]...
>
> Why is that? I have no problem with NN4 SEEING and SHOWING my CSS
> correctly...
How did you check it? Are you sure the paths are correct? (".././" etc. <-
notice the dots)
> My problem lies with SWITCHING to another style sheet using my
> PHP switcher... And it works in every other browser I tried
So, how come you suspect that PHP is the problem? If it works on other
browsers, that means, most likely the problem lies somewhere else. For
example, NN will not work with @import. (I think you know that.) NN also has
a lot of problems relative paths. And most of the time, putting the
(external) CSS in the webroot folder fixes many problems.
...[snip]...
>
> It understands... There's no problem with the INITIAL load... Just the
> switch...
Again, this depends on how you test it.
Try this, after "switching" check the resulting source code and see if what
you're expecting is really there.
...[snip]...
Well, since we cannot see how you're doing it, it's really hard to tell
where the problem lies.
Anyway, here's a very simple (and, I hope, easy to understand) code. It
works on NN4. After each "switch" try checking the resulting code. Then, try
removing the <style> tags and change the "echo" commands to echo your
"<link /> 's ". During the process, you might just find out where the
problem is. :)
- E
PS.
If ever, just try posting your code esp. the portion where you think the
problem lies...
---------- test.php ----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"
/>
<title>TEST</title>
<style type="text/css">
<!--
<?php
if (isset($_GET['var'])){
switch ($_GET['var']){
case 1:
echo 'h1 { color:black; background:white; }';
break;
case 2:
echo 'h1 { color:white; background:blue; }';
break;
case 3:
echo 'h1 { color:blue; background:yellow; }';
break;
default:
echo 'h1 { color:black; background:white; }';
break;
}
}
echo "\n";
?>
//-->
</style>
</head>
<body>
<h1>TEST</h1>
<br />
<a href="test.php?var=1">Original</a> | <a
href="test.php?var=2">White -
Blue</a> | <a href="test.php?var=3">Blue - Yellow</a>
</body>
</html>