PDA

View Full Version : Script to show txt on specific date


Madget
01-06-2006, 02:32 PM
I've been searching everywhere but couldn't find a script that displays a specific text on a specific date.

Example: On January 10, after a call to the script it will display
*Don't forget to write to John*
On January 9 it will display nothing, and on January 11 it will display nothing either.

It would be something like : date
If date = January 10 then display Don't forget to ...
which I could add into the script myself manually.

Could I include this in a .shtml file?
If there is no reminder the page displays it's normal contents, only on
a date where something is filled in it will display that reminder.

Is this possible or complicated? Is there someone less script-challenged than
I who can help me out? :-)

Cheers.

Madge
-=-

mlseim
01-06-2006, 03:22 PM
Madget ...

I PM'd you (private message)
See link in the Welcome box in upper right corner.

FishMonger
01-06-2006, 03:48 PM
use POSIX;

$date = strftime("%Y%m%d", localtime);
print "*Don't forget to write to John* " if ($date == 20060106);

EDIT:
mlseim, is the answer so secretive that it needs to be PM'd instead of posting so others can see?

FishMonger
01-06-2006, 04:08 PM
You may want to look at the Date::Calc module. This module has several functions that could be used for this task.
http://search.cpan.org/~stbey/Date-Calc-5.4/Calc.pod