# code help



## djultra89 (Oct 4, 2012)

hi there i'm having problems with this php code?
now i would like to work thursdays and sundays on our radio
that i run with friends? please help heres the code

<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h+1;

// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 12 && $h < 14) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 16 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 15 && $h < 17) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 17 && $h < 20) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 20) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 15 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 15 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 8 && $h < 10) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 10 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 15 && $h < 18) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 20 && $h < 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// SATURDAY SCHEDULE
else if ($d == 6 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 4 && $h < 5) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 5 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 8 && $h < 9) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 9 && $h < 10) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 10 && $h < 11) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 11 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 13 && $h < 14) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 14 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 15 && $h < 17) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 17 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 19 && $h < 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// SUNDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 2) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 2 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 4 && $h < 5) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 5 && $h < 6) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 6 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 8 && $h < 9) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 9 && $h < 10) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 10 && $h < 11) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 11 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 12 && $h < 16) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 16 && $h < 17) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 17 && $h < 18) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 18 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 19 && $h < 21) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 21) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';
?>


----------



## jwhkhk (Oct 16, 2012)

My laptop has windows 7 and it wont connect to the widow and when I press troubleshooting it says there is something preventing troubleshooter from starting


----------



## dukevyner (Nov 4, 2011)

whats wrong with the code?


----------



## dukevyner (Nov 4, 2011)

works perfectly fine... remember that the script uses server time


----------



## JiminSA (Dec 15, 2011)

> works perfectly fine... remember that the script uses server time


which you can change if you wish by using, e.g.

```
date_default_timezone_set('Africa/Johannesburg');
```
which is explained here


----------



## djultra89 (Oct 4, 2012)

can anyone help me with this php code please, now our dj's would like to work at a certain 
time of the day? but i just can't figure out how or were to put the times? please help

<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h+1;

// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 12 && $h < 14) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 16 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h >= 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 15 && $h < 17) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 17 && $h < 20) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 2 && $h >= 20) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 15 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 3 && $h >= 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 8 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 15 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 4 && $h >= 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 4 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 8 && $h < 10) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 10 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 13 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 15 && $h < 18) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 20 && $h < 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 5 && $h >= 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// SATURDAY SCHEDULE
else if ($d == 6 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 4 && $h < 5) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 5 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 8 && $h < 9) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 9 && $h < 10) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 10 && $h < 11) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 11 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 12 && $h < 13) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 13 && $h < 14) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 14 && $h < 15) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 15 && $h < 17) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 17 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 19 && $h < 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 6 && $h >= 22) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';

// SUNDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 2) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 2 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 4 && $h < 5) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 5 && $h < 6) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 6 && $h < 8) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 8 && $h < 9) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 9 && $h < 10) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 10 && $h < 11) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 11 && $h < 12) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 12 && $h < 16) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 16 && $h < 17) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 17 && $h < 18) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 18 && $h < 19) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 19 && $h < 21) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 0 && $h >= 21) $img = '/images2/dj/images/dj_dog.jpg';
else if ($d == 1 && $h < 0) $img = '/images2/dj/images/dj_dog.jpg';
?>


----------



## allnodcoms (Jun 30, 2007)

Er... They're already in there. $d="Day of the week", $h="Hour of the day". To translate your code into good old English, you have:

```
if ($d == 1 && $h >= 0 && $h < 4) $img = '/images2/dj/images/dj_dog.jpg';
```
Which actually means:


> If "Day of the week" is Monday and it's midnight or later and not yet 4am then DJ Dog's on!


Just change the numbers and the filenames for the images ($img).

As I said in your other post, this won't work if the user just sits in front of their PC. PHP is server side, so the page won't update unless they refresh it. To update in realtime you need javascript...

Danny


----------



## djultra89 (Oct 4, 2012)

so how can i add javascript to that script or can't i add it the that so that it updates in real time
or do you have a javascript code for that


----------



## djultra89 (Oct 4, 2012)

do you have a javascript code then?


----------



## djultra89 (Oct 4, 2012)

yes but DJ DOG is the autodj mate


----------



## allnodcoms (Jun 30, 2007)

Give this a look. It pretty much does what you're after.

Danny


----------



## djultra89 (Oct 4, 2012)

ok but will that script change the picture everytime a different dj is on air?


----------



## allnodcoms (Jun 30, 2007)

If you call the function at regular intervals it will, yes. This link should help you with the regular calling...

Danny


----------



## djultra89 (Oct 4, 2012)

ok ta could you possible help me set it up please?


----------



## djultra89 (Oct 4, 2012)

ok so i've done the code which is

function timeOfDayImage() {
var now = new Date;
var timeNow = now.getHours();
var img = null; var mess = '';
if (timeNow < 4 || timeNow > 20) {
img = 'time1.gif'; mess = 'night';
} else if (timeNow < 6) {
img = 'time2.gif'; mess = 'dawn';
} else if (timeNow < 8) {
img = 'time3.gif'; mess = 'early morning';
} else if (timeNow < 11) {
img = 'time4.gif'; mess = 'morning';
} else if (timeNow < 13) {
img = 'time5.gif'; mess = 'noon';
} else if (timeNow < 16) {
img = 'time6.gif'; mess = 'afternoon';
} else if (timeNow < 18) {
img = 'time7.gif'; mess = 'late afternoon';
} else {
img = 'time8.gif'; mess = 'sunset';
}
document.write('







');
}<noscript><img src=time5.gif" width="200" height="80" alt="time of day image - requires Javascript" /></script>

but i saved it and nothing happens take a look http://nrgextreme.co.uk/test1/test.js 
were have i gone wrong please help. or help me set it up so that it works


----------



## colinsp (Sep 5, 2007)

You have put the closing script tag in the wrong place it comes after the script and before the closing head tag.


----------



## allnodcoms (Jun 30, 2007)

You've also just done a direct "C&P" of the example script. You've gone from a piece of PHP which did half the job, to a piece of JS which does the other half... You need to put these two bits of code together (i.e. put the hours and image urls from the PHP into the JS).

You also need to call your function at regular 'intervals' (that last bit was a clue btw).

Danny


----------



## djultra89 (Oct 4, 2012)

ok could you put these two codes together for meand past it here so that i can copy it into 
the server?


----------



## allnodcoms (Jun 30, 2007)

Not really. Two reasons:

Firstly, you are the only one who knows what the hours and related images should be. If you were to type them all in here, you may as well type them straight into the script.

Secondly, doing this sort of thing is my 'day job', and I charge by the hour. I've pretty much given you the solution to this, and we're here to teach and advise - which is hopefully what I've done.

Give it a go yourself, you're not going to break anything by trying, and if you still have problems we will try and assist you further. As I've said before in your other thread, this is a tech support site, not a code repository.

Good luck...

Danny


----------



## djultra89 (Oct 4, 2012)

ok i have done what the link said and i don't think it's working for me 
here is waht i put in

<!DOCTYPE html>

// Time of Day Image Script
// copyright Stephen Chapman, 20th Jan 2005
// you may copy this script but please keep the copyright notice as well
function timeOfDayImage() {
var now = new Date;
var timeNow = now.getHours();
var img = null; var mess = '';
if (timeNow < 4 || timeNow > 20) {
img = 'time1.gif'; mess = 'night';
} else if (timeNow < 6) {
img = 'time2.gif'; mess = 'dawn';
} else if (timeNow < 8) {
img = 'time3.gif'; mess = 'early morning';
} else if (timeNow < 11) {
img = 'time4.gif'; mess = 'morning';
} else if (timeNow < 13) {
img = 'time5.gif'; mess = 'noon';
} else if (timeNow < 16) {
img = 'time6.gif'; mess = 'afternoon';
} else if (timeNow < 18) {
img = 'time7.gif'; mess = 'late afternoon';
} else {
img = 'time8.gif'; mess = 'sunset';
}
document.write('







');
}

<!DOCTYPE html>

*Menu*
HTML
CSS
JavaScript

Content goes here

Copyright © W3Schools.com


----------



## colinsp (Sep 5, 2007)

You still have the closing script tag in the wrong place like I told you before.


----------



## djultra89 (Oct 4, 2012)

ok were should the closing script tag go. or could you fix that bit for me


----------



## JiminSA (Dec 15, 2011)

Your </script> line which closes the javascript, must come after the javascript - i.e. just before the first 
You've currently got it positioned straight after the opening of your javascript - hence no javascript is being properly recognised.


----------



## JiminSA (Dec 15, 2011)

Additionally, you have a second html page (from W3Schools) pasted onto the first...
I rather think your page should look more like this...

```
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="epic.js">
// Time of Day Image Script
// copyright Stephen Chapman, 20th Jan 2005
// you may copy this script but please keep the copyright notice as well
function timeOfDayImage() {
var now = new Date;
var timeNow = now.getHours();
var img = null; var mess = '';
if (timeNow < 4 || timeNow > 20) {
img = 'time1.gif'; mess = 'night';
} else if (timeNow < 6) {
img = 'time2.gif'; mess = 'dawn';
} else if (timeNow < 8) {
img = 'time3.gif'; mess = 'early morning';
} else if (timeNow < 11) {
img = 'time4.gif'; mess = 'morning';
} else if (timeNow < 13) {
img = 'time5.gif'; mess = 'noon';
} else if (timeNow < 16) {
img = 'time6.gif'; mess = 'afternoon';
} else if (timeNow < 18) {
img = 'time7.gif'; mess = 'late afternoon';
} else {
img = 'time8.gif'; mess = 'sunset';
}
document.write('<img src="graphics\/'+img+'" width="200" height="80" alt="'+mess+'"

title="'+mess+'" />');
}
</script>
</head>

<body>
<script type="text/javascript">
timeOfDayImage();
</script>

</body>
</html>
```


----------



## JiminSA (Dec 15, 2011)

Without intended offence I'd like to point out that the help you receive here at TSG forums, is voluntary and intended to guide you in your learning curve, not to do your website for you.
I'm sure you'll agree that this principle is a good one and for your benefit in the long term. Please, in future don't use us as an unpaid website design service.


----------



## colinsp (Sep 5, 2007)

djultra89

If you had read my original post Jim wouldn't have had to repeat what I had already told you in an earlier post. You need to read and understand what you are being told otherwise you will seriously annoy people and your posts will get ignored. As Jim says we are here to help guide you and not do it for you, a lot of us get paid for doing these things in our day jobs and give our time here freely to help those that want to learn.


----------



## allnodcoms (Jun 30, 2007)

Now back to those 'day jobs'! 

Danny


----------

