gwolff2005 Posted May 28, 2009 Share Posted May 28, 2009 Hi guys I need your help. I have a livechat application. But I want the indexpage (index.php) of the chat just to be shown at a certain time (always Fridays from 08.00-10.00 pm and every Saturday from 10.00-12.00AM). Out of these hours I want the page to load another page (info.php) Can you please help me. I did not find any help how to do that. Thanks so much in advance! Link to comment https://forums.phpfreaks.com/topic/160013-page-has-to-be-load-just-on-a-certain-time/ Share on other sites More sharing options...
anupamsaha Posted May 28, 2009 Share Posted May 28, 2009 Hi guys I need your help. I have a livechat application. But I want the indexpage (index.php) of the chat just to be shown at a certain time (always Fridays from 08.00-10.00 pm and every Saturday from 10.00-12.00AM). Out of these hours I want the page to load another page (info.php) Can you please help me. I did not find any help how to do that. Thanks so much in advance! Not clear what you need. Still, will date() function help here? Link to comment https://forums.phpfreaks.com/topic/160013-page-has-to-be-load-just-on-a-certain-time/#findComment-844090 Share on other sites More sharing options...
gwolff2005 Posted May 28, 2009 Author Share Posted May 28, 2009 Hi anupamsaha, I am actually not sure if that helps. What I want to do is the following. Every friday 08.00-10.00pm and every Saturday 10.00.-12.00 am the page index.php should be loaded when clicking on a link at any other time of the week intro.php should be loaded when clicking on a link. Link to comment https://forums.phpfreaks.com/topic/160013-page-has-to-be-load-just-on-a-certain-time/#findComment-844093 Share on other sites More sharing options...
lonewolf217 Posted May 28, 2009 Share Posted May 28, 2009 Perhaps there is a more elegant way to use the function, but here is a simple way. pseudo-code: <?php if(strcasecmp(date("l"),"Friday") && date("G") >= 20 && date("G") <= 22) { //it is currently Friday between 8PM and 10PM; include 'chat.php'; } else if(strcasecmp(date("l"),"Saturday" && date("G") >=10 && date("G") <=12) { //it is currently Saturday between 10AM and 12noon include 'somethingElse.php'; } Link to comment https://forums.phpfreaks.com/topic/160013-page-has-to-be-load-just-on-a-certain-time/#findComment-844102 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.