I have an external stylesheet that I want to include php a php constant in (the constant is a url, idea being that making themes is easy - i just set the constant to the location of my theme and bingo).
To do this I'm saving my css as a .php file with the following code at the top:
I then include my constants file, and then the stylesheet like this:
include_once("includes/define.php"); ... <link href="css/main.php" rel="stylesheet" type="text/css" />
that works fine, my css is displayed as it should be, except that my defined constant is not available within the main.php css file. I can echo it out fine above or below the style sheet link and i get the value, but within that script itself it's empty. I can define the same constant within the css script and it all works fine, but the idea was the contant could be set via a database, so there would be no need to edit any source code to change themes.
I then thought if I just run the query to define the constant inside the css script, that would work fine. I tried that, but it won't work - no error message, just an empty result.
So, I'm at a loss. Anyone know why this is happening and how I can get round it?