Jump to content

page has to be load just on a certain time


gwolff2005

Recommended Posts

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!

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?

 

 

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.

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';
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.