Does anyone know if there is a way to change a table background image according to the time of day?
And if not that, then a way to change the body background image according to the time of day? (Without having to use someone else's script!)

Code: Select all
<?php if (date("G") < "6" || date("G") > "21"){ echo "image1.jpg"; } else { echo "image2.jpg"; } ?>
Code: Select all
[/b]">.
SteveL wrote:Indeed, if you were able to include PHP, just put a little something like this:
Into the background tag in the table. For example; <td background="<?php if (date("G") < "6" || date("G") > "21"){ echo "image1.jpg"; } else { echo "image2.jpg"; } ?>">. Currently, if it's before 6am and after 10pm, it'll show image1.jpg; if it's any other time it'll give a nice image2.jpg.Code: Select all
<?php if (date("G") < "6" || date("G") > "21"){ echo "image1.jpg"; } else { echo "image2.jpg"; } ?>
Obviously you can change the time of day and the images it puts by changing the relevant values.
[edit] To change the body background, just stick exactly the same code into <body background="Code: Select all
[/b]">.[/quote] Thanks for your help! But I've just tried it and it doesn't work. I put the code in exactly as you said and this... < "6" || date("G") > "21"){ echo "night.jpg"; } else { echo "day.jpg"; } ?>"> ...shows up in the table with no background. :(