Log in

View Full Version : display different html on speciefied time range



Marquis
07-10-2007, 11:18 AM
Hi all
I'm looking for a script for âbility to display different content ( html or script ) on a speciefied time range on a 24 hour base. from 8 to 10 display 1.html, from 10.01 to 12.00 display 2.html etc.

Is this possibile?

thx for help

djr33
07-10-2007, 11:41 AM
<?php
$h = date('G');
if ($h<2) {$p=1;}
else if ($h<4) {$p=2;}
else if ($h<6) {$p=3;}
...
else if ($h<22) {$p=11;}
else {$p=12;}
include($p.'.html');
?>

Something like that.

This requires PHP installed/enabled on your server and that you serve the page as php, meaning it should have a .php extension.

Marquis
07-10-2007, 02:25 PM
Hi

thanks for fast reply!

is this possible with javascript too?

jandjweb
03-29-2008, 05:39 PM
can someone change the times for me

thetestingsite
03-29-2008, 05:43 PM
Change the times one what to what? Please be more specific when posting.

jandjweb
03-29-2008, 05:57 PM
I need two pages to switch. Page Two i need to come on at 5:00 till
6:00 then page one will take over to the next day.