PenguinX Posted December 26, 2006 Share Posted December 26, 2006 I'm currently working on this script and it just doesn't seem to want to work. The script was made for me by a friend and I don't want to bother him anymore. This script is *supposed* to return an image at 19:00 server time and hold that image for 2 hours, then go back to normal image, but only on Fridays. It's not quite working, any ideas on hwy?Here it is:[code]<body bgcolor="DFDFDE"><?phpif (date('G') == '5' && date('G') >= 19 && date('G') <= 21){ $imgurl = "Image 1 URL.gif";}else{ $imgurl = "Image 2 URL.bmp";}echo "<img src=\"$imgurl\">";?> [/code] Quote Link to comment Share on other sites More sharing options...
marcus Posted December 26, 2006 Share Posted December 26, 2006 Obviously it won't work now, it's only 18:36 GMT Quote Link to comment Share on other sites More sharing options...
PenguinX Posted December 26, 2006 Author Share Posted December 26, 2006 Well, I know that much, but it won't come on Fridays though at the right time. The server's time is currently 15:00 (13:00 Central Time, 14:00 Eastern) and it needs to be on at 20:00 Server time to 22:00 Server time on Fridays only. Quote Link to comment Share on other sites More sharing options...
bljepp69 Posted December 26, 2006 Share Posted December 26, 2006 you're "if" statement doesn't work. You check for three conditions of date('G') that can't possibly be true.try:[code]if (date('w') == 5 && date('G') >= 19 && date('G') <= 21)[/code] Quote Link to comment Share on other sites More sharing options...
PenguinX Posted December 26, 2006 Author Share Posted December 26, 2006 Ha! It works, thank you very much! :) 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.