My site uses a .PHP file as it's CSS, with great success. However, I'm trying to make a new addition and I'm having extreme difficulty. I'd like to adjust how the visitor views the page depending on which variables are set (i.e. ?ref=cemetech). I figured I'd be able to include another file within my CSS for such things. So, I have getget.php & colors.php linked within my CSS like so.
Code:
Actually, at the moment I have a duplicate for the header but it's contents are as follows:
Code:
I can't get the same to work for the CSS. If you browse to an image within my portfolio, for example, you match all the criteria needed and you get the echoes on lines 5 and 6 of the page HTML but in the CSS, starting on Line 2 I don't get anything for the background image except the path I hard coded to the variable.
Is there a limitation with CSS that doesn't allow $_GET calls? Or any variables to pass to it? As I even tried removing the include from the CSS file and the line for the background image doesn't even show up, despite the headers include coming before the CSS, as you'll note from the page source.
I tried Googling but the only results I find are for getting the headers sent by the browser. I found this result, but that's a little bit out of my understanding for now. Currently, my CSS looks something like:
Code:
Code:
<?php
header("Content-type: text/css");
include('../inc/getget.php');
include('../inc/colors.php');
?>
Actually, at the moment I have a duplicate for the header but it's contents are as follows:
Code:
<?php
include('getget.php');
if(is_file($refimg)) {
echo '<!-- Is File -->';
}
if (!$img) {
echo '<!-- Not Set -->';
} else {
echo '<!-- Is Set: ' . $refimg .' -->';
}
?>
I can't get the same to work for the CSS. If you browse to an image within my portfolio, for example, you match all the criteria needed and you get the echoes on lines 5 and 6 of the page HTML but in the CSS, starting on Line 2 I don't get anything for the background image except the path I hard coded to the variable.
Is there a limitation with CSS that doesn't allow $_GET calls? Or any variables to pass to it? As I even tried removing the include from the CSS file and the line for the background image doesn't even show up, despite the headers include coming before the CSS, as you'll note from the page source.
I tried Googling but the only results I find are for getting the headers sent by the browser. I found this result, but that's a little bit out of my understanding for now. Currently, my CSS looks something like:
Code:
#nav a:hover {
background: <?=$maincolordark?> url(../img/topgradr.png) center bottom;
}