Hello,
I am able to use variables in my css with the help of php.
Now what I need to do is get a form working on my page that changes the stylesheet so that the colour scheme of the page is changed.
This is the code for my style sheet (style.php):
<?php
header("Content-type: text/css");
$colorIn = $_POST['color'];
if($colorIn == "green")
{
$color = "green";
header("Location: index.php");
}
else if($colorIn == "uberlord")
{
$color = "uberlord";
header("Location: index.php");
}
echo <<<CSS
/* --- start of css --- */
#contentLYR
{
position:absolute;
width:705px;
height:800px;
z-index:1;
border:thin solid 000000;
left: 137px;
top: 245px;
background:$color;
}
#Border
{
position:absolute;
width:680px;
height:780px;
z-index:1;
left: 10px;
top: 10px;
background:$color;
}
................
/* --- end of css --- */
CSS;
?>
And this is in my scheme changer page (index.php):
<form method="post" action="style.php">
<input type="radio" name="color" value="green" checked="checked">Green
<br>
<input type="radio" name="color" value="uberlord">Uberlord
<br>
<input type="submit" name="submit" value="Change" />
</form>
Please advise why this does not work.
Thanks anyone