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] Link to comment https://forums.phpfreaks.com/topic/31892-solved-need-a-bit-of-help/ 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 Link to comment https://forums.phpfreaks.com/topic/31892-solved-need-a-bit-of-help/#findComment-147998 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. Link to comment https://forums.phpfreaks.com/topic/31892-solved-need-a-bit-of-help/#findComment-148000 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] Link to comment https://forums.phpfreaks.com/topic/31892-solved-need-a-bit-of-help/#findComment-148016 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! :) Link to comment https://forums.phpfreaks.com/topic/31892-solved-need-a-bit-of-help/#findComment-148045 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.