Is there a way to have a site server up a different page each day?

by HipHop
1 replies
I'm looking for my landing page to server up a different version of a page dependent on the day of the week.

This isn't for it to display the day of the week, it's for a different purpose.

Does anyone know how to accomplish this?

LH
#day #page #server #site
  • Profile picture of the author Martin Avis
    It should be pretty easy by using a bit of php.

    Put this php code in your landing page:

    <?php

    $day = date("D");

    if ($day == "Mon"){
    include ("monpage.htm");
    } elseif ($day == "Tue") {
    include ("tuepage.htm");
    } elseif ($day == "Wed") {
    include ("wedpage.htm");
    } elseif ($day == "Thu") {
    include ("thupage.htm");
    } elseif ($day == "Fri") {
    include ("fripage.htm");
    } elseif ($day == "Sat") {
    include ("satpage.htm");
    } elseif ($day == "Sun") {
    include ("sunpage.htm");
    }

    ?>

    (I haven't tested it, but it should work)

    Now you can either have that code as the entire landing page and each daily page would be an entire web page, or you can just use the php code to add in a special section .

    I hope that helps.

    Martin
    Signature
    Martin Avis publishes Kickstart Newsletter - Subscribe free at http://kickstartnewsletter.com
    {{ DiscussionBoard.errors[660508].message }}

Trending Topics