Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    "include" different every day of the week

    I need aid with script PHP. I want to open a different page in "include" depending on the day of the week, with this scheme:

    Monday, Tuesday, Wednesday, Thursday and Friday = > page01.inc

    Saturdays = > page02.inc

    Sundays = > page03.inc

    You can help me in this problem. I am not very expert in PHP.

    Thanks.

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    PHP Code:
    <?php

    $day 
    date("w");

    switch(
    $day){
        case 
    0:
            include(
    "page03.inc");
            break;
        case 
    6:
            include(
    "page02.inc");
            break;
        default:
            include(
    "page01.inc");
            break;
    }
    ?>
    Last edited by Nightfire; 01-24-2004 at 09:07 AM.

  • #3
    New Coder
    Join Date
    Jan 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wonderfull. Works OK.

    Thousands of thanks.

    This forum is fantastic, I must a beer to you.


  •  

    Posting Permissions

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