Inside your day() function, $hour not set. It will be treated as 0 in a numerical context, and if you turn on the notification report, you will see warnings warning you of an undefined variable. Was it a global variable? Did you delete the code that set its value or declared global?
Edit: Also, in style style, I believe that an external CSS file would look like this:
body { background-position: 50% 50%; background-repeat: no-repeat; background-color: silver } body.day { background-image: url('images/day_sheep.jpg'); } body.night { background-image: url('images/night_sheep.jpg'); }
and then you can get rid of the CSS section of your php script, but include the above CSS file, and you only need to have the following:
<body class="<?php echo day() ? 'day' : 'night'; ?>">
source share