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> Quote Link to comment Share on other sites More sharing options...
revraz Posted October 30, 2010 Share Posted October 30, 2010 Test it? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.