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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic back ground image 1

Status
Not open for further replies.

scantron

Programmer
Jul 4, 2002
27
CA
Hi,

I'm having a problem creating a page that displays a different background image depending on what URL parameter is sent from the calling page. ie. if /Images/pic1.gif is passed from the calling page, that's the image I want to display as the background.

I have created a dynamic image this way. I just bound the images.src to the "Path" field of my DB. But with the background it doesn't allow me to bind it to the database. I tried to code it but that isn't working.

Thank you very much.
 

Hi scantron!
Your post needs more info....as of now this connversation could be formed as:

" I had a pet that was very dynamic"
- What kind of an animal was my pet?

LOL....
sorry
what platform ? what language? what URL? what DB? background of what(page, table...)?

All the best!
 
Hi thanks for helping,

Well this is a dreamweaver forum so I thought that much was understood. Windows 2000, Dreamweaver MX trial version. As for the database(Access 97), I just store the paths of the images I want to access in the field "Path". That way when the calling page passes a path eg. "/Images/pic1.gif" the called page would take that path (URL parameter) and query the Path field to find that image path. Once it has found the proper path, I would have the Background property bound to that DB field "Path" and display the appropriate image.

the problem is I don't know how to bind the background property to a field from the database. In the case of an Image object it was easy. I could just drag any of the DB fields over onto an image object and then it would be binded.

To give more an understanding of what I'm doing: I'm trying to have a page the loads a calendar image for a selected month as the background image. I have a different calendar image for each of the months. I want these images to appear as background so that I can display values over specific days on these calendars without having to switch the image every time I update a scheduled event.

Hope this helps more and thanks for helping me.

Hey I always say All the Best To!
 
"Well this is a dreamweaver forum so I thought that much was understood"
-yes but u could be using PHP,ASP,JSP,CDML,CGI, Whatever

"the problem is I don't know how to bind the background property to a field from the database"
- background OF WHAT?
table cell? backround of a whole page?
....
anyway,
Since I still do not know what programming language ur using to connect to MSAccess... the idea would be this:
ASP-------------
-----------DB-------------------------------
I am assuming that you have some database table called
"CALENDAR"
field "MONTH" txt (jan,feb...)
filed "IMG" (rel reference )

-----some.asp----------
with form field or menu called "mnMONTH" where u enter the month desired
---------------------------

-------Results/Display.asp---------------------
Dim MONTH
MONTH =Request.Form("mnMONTH") ' or Request.Querrystring
IF MONTH ="JAN" THEN
Response.Write(&quot;<table .....background=&quot;<%= RecordSet.Fields.Item(&quot;Image_field_name&quot;).Value%>&quot;> &quot;)
ENDIF
-------------------



basically it is a conditional statement that matches current or selected date with the corresponding image field and THEN used with &quot;Write&quot; function that writes out the HTML elements (table background...page background...etc)

I hope it helps
All the Best!
 
Ya you're right with ASP. I thought that was Microsoft's language. Apparently I could've been using a different one.
I apologize.

Well I already have the Request.String code. Like I said I have this feature working with an image object. Its just the background of a table or cell property that I don't know how to set.

Maybe that write statement would do the trick. Do I actually code &quot;Response&quot;? Or is that the name of some object?

(&quot;<table .....background=&quot;<%= RecordSet.Fields.Item(&quot;Image_field_name&quot;).Value%>&quot;> &quot;)
Why did you type .'s before background? Is the table supossed to be named in that space? Or would it just be <table background?

i ask cause I don't know ASP syntax. I just get Dreamweaver to do it, or at least, I try to.

Thank you so much for helping

All the very Best!
 
ok the dots were for the rest of the info on table...like width and hight,nname etc. I used dots to cut down on code posting.
you would use:
Response.Write(&quot; from previous post&quot;)
so HTML part of it is:
----------
<table width=&quot;298&quot; height=&quot;121&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; background=&quot;some_image.jpg&quot;>
<tr>
<td>&nbsp;</td>
</tr>
</table>
------------
u can use many Respose.Write per HTML tag
so:
------------------------------
Response.Write(&quot;<table width=&quot;298&quot; height=&quot;121&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; background=&quot;<%= RecordSet.Fields.Item(&quot;Image_field_name&quot;).Value%>&quot;> &quot;)
Response.Write(&quot;<tr>&quot;)
Response.Write(&quot;<td>&nbsp;</td>&quot;)
Response.Write(&quot;<tr>&quot;)
Response.Write(&quot;<table>&quot;)
----------------------------------------
or Response.Write (&quot;the whole thing&quot;)

All the Best!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top