Re: PHP & CSS
| From: | Raquel Rice | Date: | Mon, 06 Oct 2003 18:35:59 +0000 |
| Subject: | Re: PHP & CSS | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165225@lists.php.net to get a copy of this message | ||
On Mon, 06 Oct 2003 19:29:47 +0100
David Otton <phpmail@jawbone.freeserve.co.uk> wrote:
> On Mon, 6 Oct 2003 11:13:04 -0700, you wrote:
>
> >I'm currently building a dynamic site which draws page
> >configuration variables from config (ini) files. To use those
> >variables from the ini files, I write the style sheet in the
> >header of each page.
> >
> >Here's my problem. I want to link to a style sheet rather than
> >writing it to the page head, so that it's not visible by viewing
> >the page source. I'm not sure how to draw the variable values
> >from the ini file and apply them to the style sheet. Does anyone
> >have any help?
>
> How often will they change, realistically? There's a case for just
> hard-coding them - a CSS file is pretty much a config file anyway.
>
> Or running a script as a cron job that updates the CSS once a day
> from the config file.
>
> Of neither of those are acceptable... CSS files don't actually
> have to end with .css.
>
> Rename your *.css file to *.php, and add a
>
> <?
> header('Content-Type: text/css');
> ?>
>
> line at the top of the file. If you go this route, make sure
> you've got your caching headers set up correctly - if the browser
> comes back for the CSS file every single time, you've defeated the
> object of having it.
>
Good idea!
The config files MAY be changed often. Eventually, the user will be
able to exercise control over their own layout, colors, fonts,
borders, number of columns on the page. They'll have control over a
site and/or each page in a site.
--
Raquel
============================================================
He who possesses the source of enthusiasm will achieve great things.
Doubt not. You will gather friends around you as a hair clasp
gathers the hair.
--I Ching (B.C. ?)