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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help directing visitors to a "page-of-the-day"

    I am building a site which will have a message that changes each day. The page will be at mysite.com/today and I would like to serve the page based on the date on the visitor's computer.

    I would prefer to dynamically serve the page of the day and keep my visitors on the "today" page but I could also see using a redirector to send the visitor to another page marked for that day.

    Any help would be greatly appreciated!

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    If your webhost allows SSI (Server Side Includes), the message thing
    could be really easy to set-up with your existing page ... no redirection
    needed.

    Find out if your host allows SSI.

    Also, if your host allows Perl (CGI) and/or PHP.

    You didn't mention what the message was, but if it's like a quote or
    something, it could change automatically each day from a simple flat-file
    database. If it's a message you need to enter each day, you could enter
    it into a form and click a button ... message would appear on the page ...
    simple.

    No need to enter in 365 .html pages with constant redirecting.

    If you can use SSI, change the extension on the name of your page
    to .shtml (example, index.html would become index.shtml).

    Then, let us know ... we'll come up with something for you to try.

  • #4
    New Coder
    Join Date
    Aug 2005
    Location
    Kuwait-I'm American
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    or, using javascript (easier than server-side languages), you could use the "if elseif, else" attribute, and tell the browser:
    Code:
    <script type="text/javascript">
    d=date()
    if (d=../../..)
    {
    document.write ('a href="this_day.html>this link</a>')
    }
    else if (d=../../..)
    {
    document.write ('a href="this_day_2.html>this link</a>')
    }
    else
    {
    document.write ('a href="this_day_3.html>this link</a>')
    }
    </script>
    then, you just update it every 3 days.
    Last edited by ianmarlowe; 08-02-2005 at 02:39 PM. Reason: typo in the code
    i'm only 12, gimme some slack

  • #5
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank You!

    Dude!

    You guys are awesome! I really appreciate the help and the responses!

    Thanks again!


  •  

    Posting Permissions

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