Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to activate a webpage between certain dates? 1

Status
Not open for further replies.

TribeMan

Programmer
Nov 16, 2009
22
0
0
IL
I'm looking to make a certain webpage active between 2 specific dates. For example, in my default webpage I could have some ASP code saying something like:

------------------
startDate = 12/10/2010 'I'm not sure of the format
endDate = 12/25/2010
IF date is between startDate and endDate THEN
Re-direct to URL merryXmas.asp
END IF
------------------

Any help would be welcome

Thanks
 
Different date formats are accepted, depending on your locale settings. A safe format is always "YYYY-MM-DD", then use the CDate function to convert to internal date format.
Code:
startDate=CDate("2010-12-10")
endDate=CDate("2010-12-25")
if  date > startDate and date < endDate then response.redirect("[URL unfurl="true"]http://www.merryXmas.asp")[/URL]
end if

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top