Ok. For all the time I've been learning php, I didn't know what I would use it for. But now, 1 thing became clear. I can now dynamically build the site's index page to show time-relevant content. For instance, Daylight Saving Time begins this Sunday 3/13/2011 at 2:00 AM. I can post that as a message with an automatic expiration on 3/14. So as soon as I realize I need to share a certain message which is time-dependent, I can just pre-load those to the database and the PHP handles the rest automatically.
It boils down to a simple mySql statement that is essentially this: select all the messages where the valid_from date <= today's date and the valid_to date >= today's date. Then some simple logic to add a css style so that this text appears formatted like I want.
Sweet!
Later,
Andy
Tuesday, March 08, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment