So, there is an image which is set to buttonoff.png at all times except when the time is a certain time, then it changes to buttonon.png.
I can do this, and have it working nicely, the thing is, I need to make the image stay as button on for only 2 minutes instead of an hour, I need this to happen regardless of refreshing, so even if the user refreshes, that 2 minutes is still goin, I could use a cron job, but I do not know enough about them, anyway, here is the code I have to change the image when it is a specific hour of the day:
Code: Select all
<?php
$hour = 15;
if ($hour == date(H))
$buttonimage = "buttonon.png";
else
$buttonimage = "buttonoff.png";
?>
<table width="200" border="1">
<tr>
<td><img src="<?php echo($buttonimage); ?>" /></td>
</tr>
</table>Any advice would be great.
Thanks