Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
January 28, 2005, 4:42 pm
rate this thread
I have a website with linked CSS files controlling layout, via LINK
tags. In these linked CSS files, I need to create dynamic styles. This
is a website of articles, and for every article type in the MySQL
database, I need another style.
I could use PHP in the HTML head to write styles, but I'm using the
media attribute of the LINK tag to control which styles go to which
output devices. Therefore, I'd like to use PHP to author a linked CSS
Being an idiot, I had figured I could update my httpd.conf file (apache
2/redhat 8) and rewrite an AddType line to read:
AddType application/x-httpd-php .php .htm .html .css
It kind of worked. Almost. In fact, calling up the CSS in a browser
window showed that PHP did take over when asked and wrote my
article-type classes into the right places, using valid CSS.
However, once I did that, the web pages displayed as though no CSS file
Which tweak to httpd.conf or php.ini do I need to get PHP function in a
linked CSS file?