Forum Moderators: phranque

Message Too Old, No Replies

Automatically changing out a message on a daily/weekly basis?

         

balzahk

8:58 pm on Mar 19, 2008 (gmt 0)

10+ Year Member



Thanks for reading.

On a certain page on a web site I am building, I would like there to be a message displayed. Just a simple, single line message.

What I am trying to figure out is how I can easily set it up so that the message gets switched out every week.

So, let's say I could compile all the messages I want, maybe 50 or so, and put them all in a single file, or separate files, or however it is set up. Then, every week, one is taken out and the next put in it's place automatically on that page.

What is the easiest way to do this?

Thank you.

phranque

3:27 am on Mar 20, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], balzahk!

the easiest way would be to use a cgi script or php, but you could probably also do something with javascript.

balzahk

5:41 am on Mar 24, 2008 (gmt 0)

10+ Year Member



Thanks, I figured it could be done with any of those. However, do you have any more specific or detailed information? I am a beginner. Also, I've searched all over the place without finding any relevant information.

phranque

8:53 am on Mar 24, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



what type of server are you using?
how is your web content generated?
do you use a database?
does your server support cgi? php?

if your server supports SSI you could do something like:
<!--#config timefmt="%W" -->
<!--#set var="week" value="$DATE_LOCAL" -->
<!--#if expr="$week = /1/" -->
<!--#include virtual="week_1.txt" -->
<!--#elif expr="$week = /2/" -->
<!--#include virtual="week_2.txt" -->
.
.
.
<!--#endif -->

balzahk

2:52 pm on Mar 25, 2008 (gmt 0)

10+ Year Member



Linux server.

Static html/PHP pages.

No database, but I do have that option.

Thanks.