byrne86 Posted October 30, 2010 Share Posted October 30, 2010 I have this code that changes an image on the hour, of a random hour and stays changed for 2 minutes, regardless of refreshes etc etc, and it has to be the exact same hour and 2 minutes for everyone. I know at the minute it is going to change at 4pm, it is only for testing purposes, I am doind the random time bit later. <?php $minute = date(i); $hour = 16; if ($hour == date(H) && $minute < 3) $buttonimage = "buttonon.png"; else $buttonimage = "buttonoff.png"; ?> <table width="200" border="1"> <tr> <td><img src="<?php echo($buttonimage); ?>" /></td> </tr> </table> Link to comment https://forums.phpfreaks.com/topic/217294-will-this-code-work/ Share on other sites More sharing options...
revraz Posted October 30, 2010 Share Posted October 30, 2010 Test it? Link to comment https://forums.phpfreaks.com/topic/217294-will-this-code-work/#findComment-1128357 Share on other sites More sharing options...
byrne86 Posted October 30, 2010 Author Share Posted October 30, 2010 I am, but because I am doing it on the hour I am waiting until the hour hits, and I should have done it half an hour ago, but I missed it lol. I was just asking to see if anyone can see a flaw in the code. Link to comment https://forums.phpfreaks.com/topic/217294-will-this-code-work/#findComment-1128364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.