I am trying to write a short php script, however nothing is showing up on my page. Can someone tell me where I am going wrong? (I have already tested the links to the images using img src=, they work.)
<?php
$h = date('G'); //set variable $h to the hour of the day
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
if ($h < 2) $img = 'img1.jpg';
else if ($h = 3.14) $img = 'img2.jpg';
else if ($h < 4) $img = 'img3.jpg';
else if ($h < 6) $img = 'img4.jpg';
else if ($h < 8) $img = 'img5.jpg';
else if ($h < 10) $img = 'img6.jpg';
else if ($h < 14) $img = 'img7.jpg';
else if ($h < 16) $img = 'img8.jpg';
else if ($h < 18) $img = 'img9.jpg';
else if ($h < 20) $img = 'img10.jpg';
else if ($h < 22) $img = 'img11.jpg';
?>
I really appreciate it, thanks!
<?php
$h = date('G'); //set variable $h to the hour of the day
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
if ($h < 2) $img = 'img1.jpg';
else if ($h = 3.14) $img = 'img2.jpg';
else if ($h < 4) $img = 'img3.jpg';
else if ($h < 6) $img = 'img4.jpg';
else if ($h < 8) $img = 'img5.jpg';
else if ($h < 10) $img = 'img6.jpg';
else if ($h < 14) $img = 'img7.jpg';
else if ($h < 16) $img = 'img8.jpg';
else if ($h < 18) $img = 'img9.jpg';
else if ($h < 20) $img = 'img10.jpg';
else if ($h < 22) $img = 'img11.jpg';
?>
I really appreciate it, thanks!