Forums

This topic is locked

Change image based on todays date

Posted 15 Nov 2002 20:15:42
1
has voted
15 Nov 2002 20:15:42 Scott Backstrom posted:
<font face='Arial'>Wondering if anyone has writen a script that would choose an image to display based on the current calendar date. ie... a logo that changes on the first of the month to reflect that month (snowflakes in december, turkey in november etc.).

I did this once before on a site but can't remember the script and how I did it.

THANKS IN ADVANCE!

</font id='Arial'>

Replies

Replied 16 Nov 2002 00:44:26
16 Nov 2002 00:44:26 Owen Eastwick replied:
In VBScript something like:

&lt;%
varDate = DatePart("m", Date())

Select Case varDate

Case 1 varImage = "Jan.jpg"
Case 2 varImage = "Feb.jpg"
etc...

End Select
%&gt;

Then display the image:

&lt;img source="ImageDirectory/&lt;%= varImage %&gt; width="200" height="100"&gt;

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Reply to this topic