Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - date and image code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

date and image code

 Post Reply Post Reply
Author
WebCity View Drop Down
Groupie
Groupie
Avatar

Joined: 11 December 2003
Location: United States
Status: Offline
Points: 154
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebCity Quote  Post ReplyReply Direct Link To This Post Topic: date and image code
    Posted: 29 April 2008 at 9:03pm
hello I hope someone can help me.  I am trying to find a way to have a page updat a image by date.

using todays date 4/29/08

if date < 5/1/08 then nothing happens
if date = or > 5/1/08 then display image ../images/33.gif

Thanks
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2008 at 2:15pm
how about something like this:

<%
' todays date
TodaysDate = date

' show different image depending on the date today
select case TodaysDate
   
    ' date
    case "30/04/2008"

        ' show image 2
        response.write("<img src='image2.gif'")
   
    ' date
    case "01/05/2008"

        ' show image 3
        response.write("<img src='image3.gif'")
   
    ' no date match, show default image
    case else

        ' default image
        response.write("<img src='image1.gif'")

' end showing todays image
end select
%>

Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2008 at 2:17pm
I have just noticed your from the US so please modify my code to be in the correct date format for your country. I belive its month/day/year is it not ?
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2008 at 4:04pm
did you manage to get it working ?
Back to Top
WebCity View Drop Down
Groupie
Groupie
Avatar

Joined: 11 December 2003
Location: United States
Status: Offline
Points: 154
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebCity Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2008 at 3:50am
Originally posted by jamie.townsend jamie.townsend wrote:

did you manage to get it working ?
 
Yes, it did work, Thanks Sorry it took me so long to get back to you.  I been busy with spring school, baseball and boy scout events.
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2008 at 12:43pm
cool, no problem.  Just glad it worked.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.