Using php to modify a css file
| From: | Jednorozec Pokojowiec | Date: | Sun, 23 May 2004 00:32:02 +0000 |
| Subject: | Using php to modify a css file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-186774@lists.php.net to get a copy of this message | ||
I would like to use the same basic css file for different sites with
some things changed for each site. Since I have the same color in a
number of locations in the css file, changing all of them with a text
editor is getting to be a bit of a pain. So I wrapped the file with
<?php
{some php variables}
echo <<<EOT
{original css code here modified to use the variables}
EOT;
?>
Then I added the following line to my .htaccess file
AddType application/x-httpd-php .css
It works just fine at my hosting company but I can't get it to work
locally. On a Win2k system it acts as if the css file wasn't there at
all. On a Fedora core 1 Linux system some of the css is being
rendered but not all of it. All systems are running some version of
Apache and php ver 4.3.something I've spent a couple of days trying
to get this to work on my local systems and have run out of ideas.