PartyRing
28-08-2007, 05:24 PM
Ive got this php code which changes an image at a specific server time:
<?php
$timeOffset = + 0; // in hours, positive or negative
$nowHour = date("H", time() + (3600 * $timeOffset)) ;
if ($nowHour >= 16 && $nowHour < 0)
$message = '<img src="image1">';
else if ($nowHour >= 0 && $nowHour < 6)
$message = '<img src="image2">';
else if ($nowHour >= 6 && $nowHour < 17)
$message = '<img src="image3">';
else $message = '<img src="otherimage">';
print($message);
?>
And it works, i think, but theres a time problem, can anyone help or work out whats wrong? :(
<?php
$timeOffset = + 0; // in hours, positive or negative
$nowHour = date("H", time() + (3600 * $timeOffset)) ;
if ($nowHour >= 16 && $nowHour < 0)
$message = '<img src="image1">';
else if ($nowHour >= 0 && $nowHour < 6)
$message = '<img src="image2">';
else if ($nowHour >= 6 && $nowHour < 17)
$message = '<img src="image3">';
else $message = '<img src="otherimage">';
print($message);
?>
And it works, i think, but theres a time problem, can anyone help or work out whats wrong? :(