Home » questions » I am creating a web site and would like to add things like "thought for the day" or "tips"

I am creating a web site and would like to add things like "thought for the day" or "tips"

2006-08-06 16:00:01, Category: Programming & Design
I'd like to have a thought for the day or a tips pop up on my website and have people see a different one daily. How do you do this?

Answers

  1. Estelle

    On 2006-08-06 16:03:56


    There are many ways to do this. If you know javascript, you can create an array of "tips", then use the date function to call a different tips based on the modulo of the date divided by the number of element in your array. I did this on a site one time, but the site just went defunct, so I can't send you the code. This will update based on user's computer time. When i did this for edgework books, I did it based on day of the week, not number of elements in the array, but then we had to remember to update the tips weekly. Another way is to do the same via php - this way is better, since the series of tips will not be viewable in the source. If you use php, however, the "tip" will update based on server time, not on user time. An even better way would be to use a database - if you know PHP and MySQL, you can set up a simple database and enter tips, and then pull from the db. the equation would be "array Index to display" = "date parameter" % "array elements" I hope that puts you on the right path
  2. jarhead

    On 2006-08-06 16:08:57


    This site will answer your questions, and help you along the way. Good Luck