Posted by deko on 08/23/06 03:48
> or you can simply include a
> <style type="text/css">... </style> for the background image in the
> header of the page.
That sounds easier than maintaining multiple stylesheets.
Do this scenario sound correct:
Put HTML buttons on the page, something like this:
<form action="" method="post" name="newbackground">
<input type="submit" value="white">
<input type="submit" value="yellow">
</form>
Then, in the head section of the page, use PHP like this:
<head>
<style type="text/css">
<?php
if (!empty($newbackground = trim($_POST['white']))
{ ?>
#page {
background-image:url(/images/background-white.gif);
<?php }
elseif (!empty($newbackground = trim($_POST['yellow']))
{ ?>
#page {
background-image:url(/images/background-yellow.gif);
<?php } ?>
</style>
</head>
Is this correct? Something tells me I'm missing something on that form...
Thanks for the help!
[Back to original message]
|