Seems like it should be easy...

Seth Dimbert s.dimbert at fhmr.com
Thu Jan 9 03:17:00 CST 2003


LUGNuts,

I'm not a programmer.

But it seems to me that it would be pretty easy to write a small Perl or php
program to do what I want it to do.

All I want is to have a small script that looks into a simple database
(could be flat-file) and looks up information based upon the current time
and date, then displays that information.

Let me offer an example, because my actual need is too complicated to
explain.

Let's say that visitors to my website want to know what time my store is
open, and what the "Sale Item of the Day" is. So, the database would look
like this:

Date Range       Time        Sale Item
---------------------------------------
01/01 - 01/07    8:00 am     Apples
01/08 - 01/14    7:00 am     Oranges
01/15 - 01/21    4:00 pm     Watermelon
Etc...

Is that clear? On January 3, when the page loads, the script runs and
returns: "This week, we open at 8:00 am and Apples are on sale." On January
8, the page would change to, "This week, we open at 7:00 am and Oranges are
on sale."

I need the script to check the current (server) time and date against the
date range in the database every time it's called... Every time the page is
called.

Is that hard? As a non-programmer, it doesn't seem hard to me! :)

Can anyone point me at a canned solution or help me create one?

Thanks!

-SD




More information about the Kclug mailing list