AZForums: Time Based Pages - AZForums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Time Based Pages A PHP Tutorial

#1 User is offline   Oosband Icon

  • DnB Oos
  • PipPipPipPipPipPipPipPipPipPip
  • View blog
Group:
+ Legendary
Posts:
5,527
Joined:
30-August 05
Location:
UK

Posted 06 February 2006 - 06:58 AM

If you want to show different pages at different times of the day just simply use this:

<?php
// Get the current hour (24 hour format) on the server.
$sCurrentTime = date("H");
if ($sCurrentTime >= 0 && $sCurrentTime < 13)
{
header ("location: morning.php");
}
else
{
header ("location: afternoon.php");
}
?>


Change morning.php and afternoon.php to the relevant pages. I hope you find a use for this...

-- //Oosbandz.com
0

#2 User is offline   Budde Icon

  • AZ Newbie
  • Pip
  • View blog
Group:
Members
Posts:
2
Joined:
25-June 08

Posted 25 June 2008 - 12:37 PM

This is great, but I'd like to be able to have the area of it so it is a different page for:

Friday at 20:00 - 21:30

Monday, Tuesday, Wednesday, Friday at 14:00 to 14:45

Every other Friday at 19:00 to 19:45

and then when it is not these times, I'd like it to be a different page.

Could you help me with this?
Budde
Podcaster / Junior Developer / Blogger
Support Specialist for TalkShoe
0

#3 User is offline   Oosband Icon

  • DnB Oos
  • PipPipPipPipPipPipPipPipPipPip
  • View blog
Group:
+ Legendary
Posts:
5,527
Joined:
30-August 05
Location:
UK

Posted 18 July 2008 - 03:06 AM

View PostBudde, on Jun 25 2008, 01:37 PM, said:

This is great, but I'd like to be able to have the area of it so it is a different page for:

Friday at 20:00 - 21:30

Monday, Tuesday, Wednesday, Friday at 14:00 to 14:45

Every other Friday at 19:00 to 19:45

and then when it is not these times, I'd like it to be a different page.

Could you help me with this?


I don't really have time on my hands to write that script (it would be pretty difficult).
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users