472,811 Members | 1,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,811 software developers and data experts.

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 1767
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Philipp Lenssen | last post by:
I created Search.CSS which grabs Google results (using the Web API), displays as XHTML1.0 Strict + CSS, and recently also adds Thumbnails....
21
by: Dan V. | last post by:
I have tried a number of things including preloading, but the background image (water tile in header) in IE 6 will not display where other browsers will....
6
by: Sandman | last post by:
I'm having some problem here... I have a javascript I've downloaded that goes through all PNG files and enables the transparency channel in them for IE5.5+ by converting them to SPAN layers with...
6
by: Yeah | last post by:
I have alternate holiday headers for my web site, and I would like to display a certain image for an upcoming holiday. Examples: Christmas 12/10 - 12/26 New Years Eve 12/27 - 1/2...
3
by: RAllsopp | last post by:
I have a client who would like to have several pictures associated with one system. I have read about storing only the pathname to save OLE overhead and have set-up a form for my client to...
13
by: Jim Carlock | last post by:
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I...
1
by: John Phelan-Cummings | last post by:
When I add the name of a new individual in a, bound form, it will not display that personís name in a label control of a second unbound form. I have a scheduling program that I am working on. ...
7
by: eholz1 | last post by:
Hello Group, Perhaps you can help me. I have a mysql db, that holds images. Images are encoded using base64_decode/encode, etc. Image data seems fine. I have a view.php page that is supposed...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.