Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - date script
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

date script

 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 script
    Posted: 31 August 2009 at 11:08pm
Hi here is what I have.  I have 10 events  9/3/09 and 10/12/09 and so on.  I have created images for each event.  Ok this is what I want to do, I want to say  if today's date is < or = to 9/3/09 then show image 1 if today's date is greater than 9/3/09 then show image 2 and so on.
 
 
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: 05 September 2009 at 6:40pm

<%
dim date1, date2, date3, date4, date5, Cdate

Cdate = date()

date1 = #9/5/2009#
date2 = #9/12/2009#
date3 = #09/19/2009#
date4 = #09/26/2009#
date5 = #10/17/2009#

If Cdate <= date1 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date1 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date2 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date3 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date4 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date5 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

%>

Back to Top
ZipItDotCom View Drop Down
Newbie
Newbie
Avatar

Joined: 16 November 2009
Location: USA
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote ZipItDotCom Quote  Post ReplyReply Direct Link To This Post Posted: 16 November 2009 at 10:32pm
I found this code above and tried it but it either posted every picture at once then only removed them with the next date. 
 
Here is the code I have tried to make work but the image from the date before doesn't get removed.
 
<%
Dim Cdate
 
cdate = date()
 
if Cdate < #11/20/2009# > #11/25/2009# then %><img border="0" src="event1.png" width="169" height="51"><%end if
 
if Cdate < #11/26/2009# > #12/6/2009# then %><img border="0" src="event1.png" width="169" height="51"><%end if
 
if Cdate < #12/7/2009# > #12/23/2009# then %><img border="0" src="event1.png" width="169" height="51"><%end if
%>
 
 
How can I get it to post only one image at a time?  Is there a way to put the dates in ranges then when the current date is greater than the range of dates it skips the code and goest to the next range?
Back to Top
godeep View Drop Down
Newbie
Newbie


Joined: 29 January 2010
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote godeep Quote  Post ReplyReply Direct Link To This Post Posted: 31 January 2010 at 4:02pm
if Cdate >= firstDATESPECIFIED and Cdate < secondDATESPECIFIED then
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.