PHP Function: Time Based Background
Just like the time changing backgrounds that appear when using themes on iGoogle this simple function dynamically inserts css into the head of any web page to change the background and/or background image of an html tag, class or id based on the time of the day. One function call gets the job done with configuration variables to control server time offset (so the time is set to your local time) and the name of the tag, class or id you wish to add the background to.There are currently 6 times phases supported: midnight, dawn, morning, afternoon, dusk and evening. The zip file contains a working demo with images. The demo can also be accessed here.



Comments
November 11th, 2007 at 9:28 am
WOOOW
December 7th, 2007 at 12:03 pm
Thanks for the code. You do need a closing in your index.php file, though.
December 7th, 2007 at 12:21 pm
no worries. the index included in the zip is just a quick example.