Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
cannot display image in another folder at same level
Old 01-30-2009, 06:40 AM cannot display image in another folder at same level
Average Talker

Posts: 27
Trades: 0
hi there,

may sound a real basic question this but im having problem with displaying an image fron another folder at a similar level.

in my page "index.php" in my site root folder i use a php include called "sidemenu.php" which is in a subfolder "called includes", i then store my images in a folder called "images" which is a subfolder in the site root folder.

therefore my locations look like:

../index.php
../includes/sidemenu.php
../images/logo.gif

i want to use the img src tag in my sidemenu.php to display logo.gif however if i use the tag:

<img src="../images/logo.gif" />

if i preview sidemenu.php in my browser it works fine, but then it will not display the image when i preview index.php (even though it includes sidemenu.php which references logo.gif).

i presume this is probably because it is referenced from sidemenu.php which is in another level folder to index.php. is there anyway i can stop this happening? i dont really want to change my directory structures!

thanks in advance
gavrd1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-30-2009, 06:45 AM Re: cannot display image in another folder at same level
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
This is because when using the include function, the code is read from the file and parsed as if it were in the file that called the include.
So you should remove the ../ from the path.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-30-2009, 06:54 AM Re: cannot display image in another folder at same level
Average Talker

Posts: 27
Trades: 0
many thanks, that works a treat now!
gavrd1 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to cannot display image in another folder at same level
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.97891 seconds with 12 queries