English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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?

2006-08-06 12:00:01 · 2 answers · asked by Kathie O 1 in Computers & Internet Programming & Design

2 answers

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

2006-08-06 12:03:56 · answer #1 · answered by ★ Estelle ★ 6 · 0 0

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

2006-08-06 12:08:57 · answer #2 · answered by Devil Dog 6 · 0 0

fedest.com, questions and answers