[thelist] Conditionals in CSS - php?

Maximillian Schwanekamp lists at neptunewebworks.com
Thu Sep 30 20:03:42 CDT 2004

Tom Dell'Aringa wrote:

>I'm using PHP as my server side scripting. What I want to do is randomize that URL so that it
>grabs one of n photos on pageload.
Anthony Baratta wrote:

> Either way will work. Just remember to set the response header to 
> text/css when you send the completed CSS file back to the browser.

A nice advantage to using php for stylesheets is that you can also set 
the Expires header on a per-request basis.  Might be handy for what 
you're doing.  Anyway, here's an example of what I use at the top of php 
css files:
header("Content-Type: text/css");
header("Expires: ".gmdate("D, d M Y H:i:s", (time()+600)) . " GMT"); // 
Expires in 10 minutes
Maximillian Von Schwanekamp
Dynamic Websites and E-Commerce
NeptuneWebworks.com <http://www.neptunewebworks.com/>
voice: 541-302-1438
fax: 208-730-6504

More information about the thelist mailing list