Lets say the date range was 2005-04-25 to 2005-05-05, and todays date was 2005-04-28, then that means I want it to display the image file named 2005-04-27.jpg. If todays date was 2005-04-29, then it will display the image file named 2005-04-29.jpg instead.

...

Am I on the right track?

IMO, no, because it is not clear to me that you have fully specified the problem. Examples are essentially anecdotes; they are handy in some situations but they're not good enough to specify a task. Forget about programming for a second and imagine that you have hired a very expensive programmer to do this for you, and that you have to specify for him/her exactly what you want. Any mis-specification will end up costing you megabucks. Now, with this scenario in mind: what do you want to do?

Once you know exactly what you want you can hope to write a program to do it.

Of course, this is easier said than done, and often the process of programming significantly influences one's idea of what one wants, but still I think it is essential to start out with as clear and unambiguous specification of the task at hand as possible before one starts even thinking about programming it.

the lowliest monk


In reply to Re: Displaying a Image based on date range by tlm
in thread Displaying a Image based on date range by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.