Web Analytics Made Easy -
StatCounter Need help directing visitors to a "page-of-the-day" - CodingForum

Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    Javascript - http://winfolinx.com/tips/howto/redirect/redirday.htm
    markaylward.co.uk

    Comment


    • #3
      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.

      Comment


      • #4
        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; Aug 2, 2005, 09:39 AM. Reason: typo in the code
        i'm only 12, gimme some slack

        Comment


        • #5
          Thank You!

          Dude!

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

          Thanks again!

          Comment

          Working...
          X