Possible Duplicate:
.htaccess rewrite image file to php script
How can I execute a PHP script when a user visits a page/file that is not a PHP file?
For example, if they visited a .css file, how would I make it so that I could execute php code before they got access to it?
This is a more simplistic approach, but you can have PHP output the CSS and configure the server to parse CSS files as PHP files:
So, if you’re using Apache, you’d do something like this:
Then, in your CSS file, do this: