Hallo allemaal ik heb een scriptje die de juiste afbeelding moet ophalen enkel doet hij het niet.
Kan iemand mij vertellen wat er niet goed gaat? Alvast bedankt
$h = date('H'); //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+0;
// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 8) $img = 'https://www.hitradiocentraalfm.nl/assets/images/nonstop.png';;
else if ($d == 1 && $h >= 8 && $h < 9) $img = 'https://hitradiocentraalfm.nl/assets/images/eenmaster.png';
else if ($d == 1 && $h >= 9 && $h < 13) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 1 && $h >= 13 && $h < 14) $img = 'https://hitradiocentraalfm.nl/assets/images/goudkoorts.png';
else if ($d == 1 && $h >= 14 && $h < 15) $img = 'https://hitradiocentraalfm.nl/assets/images/demuziekfabriek.png';
else if ($d == 1 && $h >= 15 && $h < 16) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 1 && $h >= 16 && $h < 17) $img = 'https://hitradiocentraalfm.nl/assets/images/middleoftheroad.png';
else if ($d == 1 && $h >= 17 && $h < 19) $img = 'https://hitradiocentraalfm.nl/assets/images/dekkerradio.png';
else if ($d == 1 && $h >= 19 && $h < 21) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 1 && $h >= 21 && $h < 23) $img = 'https://hitradiocentraalfm.nl/assets/images/winkelwagenshow.png';
else if ($d == 1 && $h >= 21) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 2 && $h < 0) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 8) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 2 && $h >= 8 && $h < 9) $img = 'https://hitradiocentraalfm.nl/assets/images/eenmaster.png';
else if ($d == 2 && $h >= 9 && $h < 13) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 2 && $h >= 13 && $h < 14) $img = 'https://hitradiocentraalfm.nl/assets/images/goudkoorts.png';
else if ($d == 2 && $h >= 14 && $h < 15) $img = 'https://hitradiocentraalfm.nl/assets/images/demuziekfabriek.png';
else if ($d == 2 && $h >= 15 && $h < 16) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 2 && $h >= 16 && $h < 17) $img = 'https://hitradiocentraalfm.nl/assets/images/middleoftheroad.png';
else if ($d == 2 && $h >= 17 && $h < 19) $img = 'https://hitradiocentraalfm.nl/assets/images/dekkerradio.png';
else if ($d == 2 && $h >= 19 && $h < 20) $img = 'https://hitradiocentraalfm.nl/assets/images/reggearewindontheblock.png';
else if ($d == 2 && $h >= 20 && $h < 22) $img = 'https://hitradiocentraalfm.nl/assets/images/goudenfoutshow.png';
else if ($d == 2 && $h >= 22) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 3 && $h < 0) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 8) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 3 && $h >= 8 && $h < 9) $img = 'https://hitradiocentraalfm.nl/assets/images/eenmaster.png';
else if ($d == 3 && $h >= 9 && $h < 11) $img = 'https://hitradiocentraalfm.nl/assets/images/robopwoensdag.png';
else if ($d == 3 && $h >= 11 && $h < 12) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 3 && $h >= 12 && $h < 13) $img = 'https://hitradiocentraalfm.nl/assets/images/goudkoorts.png';
else if ($d == 3 && $h >= 13 && $h < 14) $img = 'https://hitradiocentraalfm.nl/assets/images/oranjetop30herhaling.png';
else if ($d == 3 && $h >= 14 && $h < 15) $img = 'https://hitradiocentraalfm.nl/assets/images/demuziekfabriek.png';
else if ($d == 3 && $h >= 15 && $h < 16) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 3 && $h >= 16 && $h < 17) $img = 'https://hitradiocentraalfm.nl/assets/images/middleoftheroad.png';
else if ($d == 3 && $h >= 17 && $h < 19) $img = 'https://hitradiocentraalfm.nl/assets/images/dekkerradio.png';
else if ($d == 3 && $h >= 19 && $h < 22) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 3 && $h >= 22) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 4 && $h < 0) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 8) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 4 && $h >= 8 && $h < 9) $img = 'https://hitradiocentraalfm.nl/assets/images/eenmaster.png';
else if ($d == 4 && $h >= 9 && $h < 13) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 4 && $h >= 13 && $h < 14) $img = 'https://hitradiocentraalfm.nl/assets/images/goudkoorts.png';
else if ($d == 4 && $h >= 14 && $h < 15) $img = 'https://hitradiocentraalfm.nl/assets/images/demuziekfabriek.png';
else if ($d == 4 && $h >= 15 && $h < 16) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 4 && $h >= 16 && $h < 17) $img = 'https://hitradiocentraalfm.nl/assets/images/middleoftheroad.png';
else if ($d == 4 && $h >= 17 && $h < 19) $img = 'https://hitradiocentraalfm.nl/assets/images/dekkerradio.png';
else if ($d == 4 && $h >= 19 && $h < 22) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 4 && $h >= 22 && $h < 23) $img = 'https://www.hitradiocentraalfm.nl/assets/images/tourguidepodcast.png';;
else if ($d == 4 && $h >= 21) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 5 && $h < 0) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 8) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 5 && $h >= 8 && $h < 9) $img = 'https://hitradiocentraalfm.nl/assets/images/eenmaster.png';
else if ($d == 5 && $h >= 9 && $h < 13) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 5 && $h >= 13 && $h < 14) $img = 'https://hitradiocentraalfm.nl/assets/images/goudkoorts.png';
else if ($d == 5 && $h >= 14 && $h < 15) $img = 'https://hitradiocentraalfm.nl/assets/images/demuziekfabriek.png';
else if ($d == 5 && $h >= 15 && $h < 16) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 5 && $h >= 16 && $h < 17) $img = 'https://www.hitradiocentraalfm.nl/assets/images/middleoftheroad.png';;
else if ($d == 5 && $h >= 17 && $h < 18) $img = 'https://www.hitradiocentraalfm.nl/assets/images/hadiedave.png';;
else if ($d == 5 && $h >= 18 && $h < 20) $img = 'https://www.hitradiocentraalfm.nl/assets/images/dekkerradio.png';;
else if ($d == 5 && $h >= 20 && $h < 22) $img = 'https://hitradiocentraalfm.nl/assets/images/peterfietsthetweekendin.png';
else if ($d == 5 && $h >= 22) $img = 'https://www.hitradiocentraalfm.nl/assets/images/2uurwhitelion.png';;
else if ($d == 6 && $h < 0) $img = 'https://www.hitradiocentraalfm.nl/assets/images/2uurwhitelion.png';;
// SATURDAY SCHEDULE
if ($d == 6 && $h >= 0 && $h < 14) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 6 && $h >= 14 && $h < 15) $img = 'https://hitradiocentraalfm.nl/assets/images/oranjetop30.png';
else if ($d == 6 && $h >= 15 && $h < 17) $img = 'https://hitradiocentraalfm.nl/assets/images/radiospektakel.png';
else if ($d == 6 && $h >= 17 && $h < 19) $img = 'https://hitradiocentraalfm.nl/assets/images/dejaren70.png';
else if ($d == 6 && $h >= 19 && $h < 21) $img = 'https://hitradiocentraalfm.nl/assets/images/hollandsplein.png';
else if ($d == 6 && $h >= 21) $img = 'https://www.hitradiocentraalfm.nl/assets/images/nonstop.png';;
else if ($d == 0 && $h < 0) $img = 'https://www.hitradiocentraalfm.nl/assets/images/nonstop.png';;
// Sunday SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 8) $img = 'https://www.hitradiocentraalfm.nl/assets/images/nonstop.png';;
else if ($d == 0 && $h >= 8 && $h < 10) $img = 'https://hitradiocentraalfm.nl/assets/images/deconnectie.png';
else if ($d == 0 && $h >= 10 && $h < 13) $img = 'https://hitradiocentraalfm.nl/assets/images/hetradiofestijn.png';
else if ($d == 0 && $h >= 13 && $h < 15) $img = 'https://hitradiocentraalfm.nl/assets/images/19toen.png';
else if ($d == 0 && $h >= 15 && $h < 18) $img = 'https://hitradiocentraalfm.nl/assets/images/nonstop.png';
else if ($d == 0 && $h >= 17 && $h < 18) $img = 'https://hitradiocentraalfm.nl/assets/images/dehitkampioen.png';
else if ($d == 0 && $h >= 18 && $h < 20) $img = 'https://hitradiocentraalfm.nl/assets/images/klooienmetvanrooijen.png';
else if ($d == 0 && $h >= 20 && $h < 22) $img = 'https://hitradiocentraalfm.nl/assets/images/baars&co.png';
else if ($d == 0 && $h >= 22) $img = 'https://hitradiocentraalfm.nl/assets/images/danceexspress.png';
else if ($d == 1 && $h < 0) $img = 'https://hitradiocentraalfm.nl/assets/images/danceexpress.png';
?>
<div class="image-wrapper">
<img src="<?php echo $img; ?>" width="1000" height="300">
</div></div>
2.448 views