...

View Full Version : Need help directing visitors to a "page-of-the-day"



webservant7
08-02-2005, 02:31 AM
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!

mark87
08-02-2005, 12:11 PM
Javascript - http://winfolinx.com/tips/howto/redirect/redirday.htm

mlseim
08-02-2005, 12:57 PM
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.

ianmarlowe
08-02-2005, 01:54 PM
or, using javascript (easier than server-side languages), you could use the "if elseif, else" attribute, and tell the browser:


<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.

webservant7
08-04-2005, 09:35 PM
Dude!

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

Thanks again!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum