Edit: third post is relevant, the first two are an excercise in "how not to....."
This is a "How should I...." question, more than an hour of searching around the forum hasn’t got me any further.
My goal is for a visitor to my website to be able to change the colours of the website.
I am doing this so far by having a dynamic "css.php" page, as in..
<?php
header('content-type:text/css');
$colour_scheme = $_GET['colour_scheme'];
$backgrounds = array('#FFFFFF','#B4E39D','#F6F7DD');
$background = $backgrounds[$colour_scheme];
I then have this in the header of the template...
<link rel="stylesheet" href="[(base_url)]assets/templates/template/{{Css_path}}" type="text/css" media="screen" />
with the ((Css_path}} chunk containing...
Now, what I would like is that the website visitor could use a form to change that $colour_scheme variable in the chunk, and eventually I would like the chunk to react to a cookie ( or some other method ) so that the whole site gets that colour scheme, for at least as long as the session.
The reason for all this ( which may or not be a crazy way of going about things ) is I need the colours of the website to alter, I don’t want to have duplicate templates and have to alter them all, the same goes for the css file.
( I’m not trying to do a Zen Garden thing here, I’m thinking accessibilty ( colour blindness ) )
So, am I trying re-invent the wheel here?