Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

I can not see my pictures when I use Server Side Includes

New Here ,
Nov 03, 2011 Nov 03, 2011

I am trying to use SSI in my header and it will not show the image if the page is to deep in my files:

Does not work:

http://www.campingcoaches.com/states/oregon/oregon.php The code is <?php include("../../includes/header2.php"); ?>

but is I move it up on level:

http://www.campingcoaches.com/states/colorado.php the Code is <?php include("../includes/header2.php"); ?>

Then it seems to work fine

I have also tried to make the header relative to the site root at that point I got a error message.

http://www.campingcoaches.com/states/oregon/oregon.php you can see the code error

The menus both use the same Code and they work?

<?php include("../../includes/menu2.php"); ?>

I am playing around and learning this so my knowledge base is relitively thin but I enjoy computers and the outdoors. Bottom line be gentle and assume you are I know very little at age 50 and just getting started.

This was already posted in Adobe Forums > Dreamweaver > Dreamweaver Development Toolbox > PHP Application Development > Discussions  without a response so I thought i might be in the wrong area.

Thank you for any help that might be offered,

Gene

All it takes for Evil to thrive is for good people to do NOTHING

TOPICS
Server side applications
970
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 04, 2011 Nov 04, 2011

As I suspected.  All links in include files must be root relative links, not document relative ones.

This link does not work -

<img src="../images/family 2.jpg"  (document relative)

while this link does work -

<a class="MenuBarItemSubmenu" href="/index.php"> (root relative)

Make all links in your include files be root relative, and you'll never have a problem.

Translate
LEGEND ,
Nov 03, 2011 Nov 03, 2011

http://www.campingcoaches.com/states/oregon/oregon.php The code is <?php include("../../includes/header2.php"); ?>

Show us the code in header2.php, please.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2011 Nov 03, 2011

The header that does not work

<div align="right"><img src="../images/family 2.jpg" width="320" height="226" /><img src="../images/hiking mountain ridge 2.jpg" width="760" height="226" /></div>

The menus are that works is:

<ul id="MenuBar1" class="MenuBarHorizontal">
    <li><a class="MenuBarItemSubmenu" href="/index.php">Home</a></li>
    <li><a href="#">RV Camping</a></li>
    <li><a href="#">Tent Camping</a></li>
     <li><a href="/Googlemaptest_3.php">Back Packing</a>
       <ul>
         <li><a href="#">Trails</a></li>
         <li><a href="/Googlemaptest_4.php" class="MenuBarItemSubmenu">Local Hikes</a>
           <ul>
             <li><a href="#">Pacific Crest Trail</a></li>
           </ul>
         </li>
       </ul>
     </li>
    <li><a href="#">With the Kids</a></li>
    <li><a href="#">Camping Tips</a></li>
    <li><a href="#">Ask a Friend</a></li>
    <li><a href="/web_pages/about_us.php">About us</a></li>
</ul>

<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>

if you need anything else just let me know.

Gene

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2011 Nov 04, 2011

As I suspected.  All links in include files must be root relative links, not document relative ones.

This link does not work -

<img src="../images/family 2.jpg"  (document relative)

while this link does work -

<a class="MenuBarItemSubmenu" href="/index.php"> (root relative)

Make all links in your include files be root relative, and you'll never have a problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2012 Jan 25, 2012
LATEST

Perfect, thank you some much for taking the time to help beginners like me sorry it took so long to reply I thought I already responded

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines