Click to See Complete Forum and Search --> : Images within Inculde file
myself1
08-20-2006, 04:25 PM
Hi,
I would like to know is it poss to show images from the images folder when used within an include file?
Folders I have are:
inc
images
The include files are requested via a Querystring, but images don't show.
I've tried the following in the include file:
../images/img1.jpg
images/img1.jpg
still blank.
Any clues?
ahk2chan
08-20-2006, 10:30 PM
I think the best way to debug the issue is look at the HTML source code when you view your ASP, and see what path does it end up generated for the image. Then you can adjust your code in the include file to get the right path.
vanny
08-21-2006, 01:47 AM
How about using absolute URLS so that no matter which page the calls the include and where is is located in the folder structure it will still show correctly.
http://www.websitename.com/application/images/img1.jpg
myself1
08-21-2006, 03:12 AM
Thanks guys...
Vanny...is there an example i could look at? :)
(link does not work)
Terrorke
08-21-2006, 04:22 AM
It's not recommended to use absolute links.
If you change anything at your site or applications, you end up changing every link used in your code.
Try using virtual includes.
(ByTheWay the link vanny provided is the example :))
russell
08-21-2006, 08:55 AM
ALWAYS ALWAYS ALWAYS use virtual paths from the root of your site. This is true whether you are using images, include files, css files, js files -- everything.
This is one of the most common errors people make and then their includes don't work or their images don't display.
See THIS THREAD (http://www.webdeveloper.com/forum/showthread.php?t=110351) for a closer examination of the topic.