470,826 Members | 2,018 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,826 developers. It's quick & easy.

Display different image between dates using ASP

Hello -- I would like to display a different logo on my website for
different seasons of the month.

I currently have a logo for Halloween, Thanksgiving, and December.

Can someone tell me what VBScript/ASP code I need to display an HTML image.

Basically:
1) any date from 10/01 thru 10/31 I would like to display the Halloween.
2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
3) any date between 12/01 - 12/31, I would like to display the Christmas.

Any help would be appreciated.

Jul 21 '05 #1
7 1705
a simple IF/THEN with Response.Write() will work if you dont store the info
in a DB.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
Hello -- I would like to display a different logo on my website for
different seasons of the month.

I currently have a logo for Halloween, Thanksgiving, and December.

Can someone tell me what VBScript/ASP code I need to display an HTML
image.

Basically:
1) any date from 10/01 thru 10/31 I would like to display the Halloween.
2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
3) any date between 12/01 - 12/31, I would like to display the Christmas.

Any help would be appreciated.

Jul 21 '05 #2
I understand that -- but a simple:

If Date > 10/01 And Date < 10/31 Then
Response.write "Display Logo1"
Elese
Response.write "Display Logo 2"
End If

Doesn't work..

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
a simple IF/THEN with Response.Write() will work if you dont store the info
in a DB.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
Hello -- I would like to display a different logo on my website for
different seasons of the month.

I currently have a logo for Halloween, Thanksgiving, and December.

Can someone tell me what VBScript/ASP code I need to display an HTML
image.

Basically:
1) any date from 10/01 thru 10/31 I would like to display the Halloween.
2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
3) any date between 12/01 - 12/31, I would like to display the Christmas.

Any help would be appreciated.


Jul 21 '05 #3
this works for me

<%
if Date > "12/1/2004" and Date < "12/31/2004" then
response.write "yes"
else
response.write "no"
end if
%>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I understand that -- but a simple:

If Date > 10/01 And Date < 10/31 Then
Response.write "Display Logo1"
Elese
Response.write "Display Logo 2"
End If

Doesn't work..

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
a simple IF/THEN with Response.Write() will work if you dont store the
info in a DB.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
Hello -- I would like to display a different logo on my website for
different seasons of the month.

I currently have a logo for Halloween, Thanksgiving, and December.

Can someone tell me what VBScript/ASP code I need to display an HTML
image.

Basically:
1) any date from 10/01 thru 10/31 I would like to display the Halloween.
2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
3) any date between 12/01 - 12/31, I would like to display the
Christmas.

Any help would be appreciated.



Jul 21 '05 #4
What if I don't want to hardcode the year?
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
this works for me

<%
if Date > "12/1/2004" and Date < "12/31/2004" then
response.write "yes"
else
response.write "no"
end if
%>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I understand that -- but a simple:

If Date > 10/01 And Date < 10/31 Then
Response.write "Display Logo1"
Elese
Response.write "Display Logo 2"
End If

Doesn't work..

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
a simple IF/THEN with Response.Write() will work if you dont store the
info in a DB.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
Hello -- I would like to display a different logo on my website for
different seasons of the month.

I currently have a logo for Halloween, Thanksgiving, and December.

Can someone tell me what VBScript/ASP code I need to display an HTML
image.

Basically:
1) any date from 10/01 thru 10/31 I would like to display the
Halloween.
2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
3) any date between 12/01 - 12/31, I would like to display the
Christmas.

Any help would be appreciated.




Jul 21 '05 #5
if Date > CDate("12/1/" & Year(Date)) and Date < CDate("12/31/" &
Year(Date)) then
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:u4**************@TK2MSFTNGP12.phx.gbl...
What if I don't want to hardcode the year?
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
this works for me

<%
if Date > "12/1/2004" and Date < "12/31/2004" then
response.write "yes"
else
response.write "no"
end if
%>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I understand that -- but a simple:

If Date > 10/01 And Date < 10/31 Then
Response.write "Display Logo1"
Elese
Response.write "Display Logo 2"
End If

Doesn't work..

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
a simple IF/THEN with Response.Write() will work if you dont store the
info in a DB.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
> Hello -- I would like to display a different logo on my website for
> different seasons of the month.
>
> I currently have a logo for Halloween, Thanksgiving, and December.
>
> Can someone tell me what VBScript/ASP code I need to display an HTML
> image.
>
> Basically:
> 1) any date from 10/01 thru 10/31 I would like to display the
> Halloween.
> 2) any date between 11/01 - 11/30, I would like to display
> Thanksgiven.
> 3) any date between 12/01 - 12/31, I would like to display the
> Christmas.
>
> Any help would be appreciated.
>
>
>



Jul 21 '05 #6
Or

Select Case Month(date)
Case 1
Response.write "January"
....
End Select

DavidM wrote:
What if I don't want to hardcode the year?
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
this works for me

<%
if Date > "12/1/2004" and Date < "12/31/2004" then
response.write "yes"
else
response.write "no"
end if
%>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I understand that -- but a simple:

If Date > 10/01 And Date < 10/31 Then
Response.write "Display Logo1"
Elese
Response.write "Display Logo 2"
End If

Doesn't work..

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
a simple IF/THEN with Response.Write() will work if you dont store
the info in a DB.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:Ok**************@tk2msftngp13.phx.gbl...
> Hello -- I would like to display a different logo on my website
> for different seasons of the month.
>
> I currently have a logo for Halloween, Thanksgiving, and December.
>
> Can someone tell me what VBScript/ASP code I need to display an
> HTML image.
>
> Basically:
> 1) any date from 10/01 thru 10/31 I would like to display the
> Halloween.
> 2) any date between 11/01 - 11/30, I would like to display
> Thanksgiven. 3) any date between 12/01 - 12/31, I would like to
> display the Christmas.
>
> Any help would be appreciated.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 21 '05 #7
Ahhh---such an elegant approach.

I like this much better.

strImage="logo_default.gif"
Select Case Month(Date)
Case 10
strImage="logo_oct.gif"
Case 11
strImage="logo_nov.gif"
Case 12
strImage="logo_dec.gif"
End Select

Perfect and makes perfect sense.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:O9**************@TK2MSFTNGP14.phx.gbl...
Or

Select Case Month(date)
Case 1
Response.write "January"
...
End Select

DavidM wrote:
What if I don't want to hardcode the year?
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
this works for me

<%
if Date > "12/1/2004" and Date < "12/31/2004" then
response.write "yes"
else
response.write "no"
end if
%>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DavidM" <sp**@spam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I understand that -- but a simple:

If Date > 10/01 And Date < 10/31 Then
Response.write "Display Logo1"
Elese
Response.write "Display Logo 2"
End If

Doesn't work..

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
> a simple IF/THEN with Response.Write() will work if you dont store
> the info in a DB.
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "DavidM" <sp**@spam.net> wrote in message
> news:Ok**************@tk2msftngp13.phx.gbl...
>> Hello -- I would like to display a different logo on my website
>> for different seasons of the month.
>>
>> I currently have a logo for Halloween, Thanksgiving, and December.
>>
>> Can someone tell me what VBScript/ASP code I need to display an
>> HTML image.
>>
>> Basically:
>> 1) any date from 10/01 thru 10/31 I would like to display the
>> Halloween.
>> 2) any date between 11/01 - 11/30, I would like to display
>> Thanksgiven. 3) any date between 12/01 - 12/31, I would like to
>> display the Christmas.
>>
>> Any help would be appreciated.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Philipp Lenssen | last post: by
6 posts views Thread by Yeah | last post: by
7 posts views Thread by eholz1 | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.