Results 1 to 3 of 3

Thread: how to load web pages by date

  1. #1
    Join Date
    Oct 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to load web pages by date

    I am looking for a way to have specific web pages load depending on the date. For example, the first week of the month a particular page would load and the remainder of the month another. Thanks in advance.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Maybe this will give you a starting point;

    PHP Code:
    <?php // special date is November 1st 2010
    $spec_date '2010-11-01';
    $todays_date date('Y-m-d');
    $today strtotime($todays_date);
    $special_date strtotime($spec_date);
    if (
    $special_date == $today
    ?>
        <!-- put special one-day content here -->
        <p>You are seeing this content because the date is November 1st 2010.</p>
    <?php } else { ?>
        <!-- put other content here -->
        <p>Usual content.</p>
    <?php ?>
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

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

    Default

    You could also use the include() function to store the two pages as separate files.
    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

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
  •