Dear all,
I have already asked this question in the same forum although it was hard to explain and no one could find the solution.
However I will try again and try to me more thorough.
Any questions/more information then please ask.
Okay I have an HTML page with CSS (the CSS has PHP in it so the variable e.g. link images can change when different colour schemes are chosen).
The CSS and PHP styling page:
<?php
header('Content-Type: text/css');
$style = (isset($_GET['style'])) ? $_GET['style'] : 'default';
switch($style)
{
case 'green':
$fg = '#FFFFCC';
$bg = '#9fa2a9';
...
#linksDiv
{
position:absolute;
width:705px;
height:800px;
z-index:1;
border:thin solid;
left: 137px;
top: 275px;
background:<?php echo $fg; ?>;
}
At the top of the HTML page:
<?php
session_start();
$styles = array('default','green','cream');
if(isset($_POST['style']) and in_array($_POST['style'], $styles))
{
$style = $_POST['style'];
setcookie('style', $style, time()+(300*24*60*60));
}
elseif(isset($_COOKIE['style']) and in_array($_COOKIE['style'], $styles))
{
$style = $_COOKIE['style'];
setcookie('style', $style, time()+(300*24*60*60));
}
else
{
$style = 'default';
}
?>
Actually in the HTML page:
<form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post'>
<input type='radio' name='style' id='style_default' value='default' checked='checked'><label for='style_default'>Default</label><br>
<input type='radio' name='style' id='style_green' value='green'><label for='style_green'>Green</label><br>
<input type='radio' name='style' id='style_cream' value='cream'><label for='style_cream'>Cream</label><br>
<input type='image' src='change.gif' border='0'>
</form>
But when I do this for link images (link image changes when different style chosen) it does not work i.e. link is un-clickable:
<div id="rightLink3">
<a href="http://127.0.0.1/aPage.php"></a>
</div>
Div background variable changes in CSS with use of the HTML form.
Someone please help.
Cheers
John