Results 1 to 6 of 6

Thread: display different html on speciefied time range

  1. #1
    Join Date
    Jul 2007
    Posts
    34
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default display different html on speciefied time range

    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

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    PHP Code:
    <?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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jul 2007
    Posts
    34
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default

    Hi

    thanks for fast reply!

    is this possible with javascript too?

  4. #4
    Join Date
    Oct 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    can someone change the times for me

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Change the times one what to what? Please be more specific when posting.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  6. #6
    Join Date
    Oct 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •