CodeAve.com CodeAve.com - ASP - Read/Write
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Date Dependent Content
Displaying content depending on what the current date value is a powerful and effective tool that adds value to any website. Whether it is to showcase a limited time offer, or to “automatically” update pages with new content while you’re miles away. The following code repeats the process to three times to demonstrate the full effects of date dependent content. The content is set to display only on 12/31/1999 and shows a preview and how many days until the content will show up and an after view after expiration.
View the Output
Text View
Print View
Mail this Link
Download the Code

<% 
' The following for next loop is used to demonstrate
' how this code will work on three different dates
' The varible the_date should be set to date() to retrieve 
' the current date when implemented 
for count = 1 to 3
if count = 1 then 
the_date=#12/30/1999#
end if
if count = 2 then 
the_date=#12/31/1999#
end if
if count = 3 then 
the_date=#01/01/2000#
end if
start_date= #12/31/1999#
expiration_date = #01/01/2000#

%>




<%= "Start Date=" & start_date &" End Date=" & expiration_date & " Today=" & the_date
%>

<br>

<% if start_date <= the_date then %> 


<% 
if expiration_date - the_date <= 0 then 
%>


Content has expired <u>on</u> <%= expiration_date %>

<%
else
%>


Content will appear <u>for</u> <%= expiration_date - the_date %> more day(s)

<%
end if
%>


<% 
else
%>

Content will appear <u>in</u> <%= abs(the_date - start_date) %> more day(s)

<%
end if
%>

<p>&nbsp;</p>
<%
next
%>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
Maps: Map Script Writers | Bing Maps | Google Maps
Privacy Statement

CodeAve.com is hosted by MyHosting.com
Donate Food Online with a Mouse Click at TheHungerSite.com
Donate Land Online with a Mouse Click at TheRainForestSite.com
© 1999 - 2014 CodeAve.com
All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3