How can I echo w/ PHP , custom css directives into this css file?
http://www.easysavannah.com/myspa开发者_JAVA百科ce1/template/default/css.css I use this program now to beta a Myspace type site >
Make your server parse CSS files as PHP and then add this at the top of your CSS files:
<?php Header ("Content-type: text/css");?>
I believe the .htaccess line to make CSS files run through PHP is:
AddType application/x-httpd-php .css
Warning! Opera will try to cache php files with css content types. It is recommended that in addition to declaring a text/css content type, you include the entire following code at the beginning of your CSS file:
<?php
header("Content-type: text/css");
//http://www.thinkvitamin.com/features/webapps/serving-javascript-fast
//required so Opera does not cache this file
# 'Expires' in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
# Always modified
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
# HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
# HTTP/1.0
header("Pragma: no-cache");
?>
To remind myself that these are css files, I maintain the following naming convention:
file-name.css.php
精彩评论