PHP parsed css file that does not work
Posted: Sat Mar 17, 2007 12:02 pm
I am experimenting with using PHP to replace bits of data in css files. The idea goes like this. Assign a server base value in a config file. In the css file have php code that echos the server base at the beginning
config.php:
structure.css:
I have set up the server to parse css type files with this in my .htaccess:
The css ends up looking like this:
like I would expect. There is one little problem however, all the CRLF have been replaced with LF. This makes Firefox choke on the css. I am looking for a setting or technique to make sure that the result of the PHP parsing my structure.css is CRLF being preserved.
Ideas anyone?
config.php:
Code: Select all
<?
$base = "http://www.mydomain.com";
?>Code: Select all
.myclass{
background-image: url(<? echo $base; ?>/images/image.jpg);
}Code: Select all
AddHandler php-script .cssCode: Select all
.myclass{
background-image: url(http://www.mydomain.com/images/image.jpg);
}Ideas anyone?