1

This is all that is contained on my home.php page

<?php
    include ('../bgs/bg-verbier.html');
    include('../menus/menu-verbier.html');
?>

both of the requested pages lie in the parent directory. The /menus/menu-verbier.html has posed no problem from the include function, however the '../bgs/bg-verbier.html is. The file as been found however the images aren't displaying.

The path of the images is working on a .php page that lies in the same parent directory,

Here's the ../bgs/bg-verbier.html' file:

<div id="bg">
    <b><i><i><img src="images/verbier/0.jpg"></i></i></b>
    <!--b:holder, i#1: large canvas, i#2: center verticaly -->
    <b><i><i><img src="images/verbier/1.jpg"></i></i></b>
    <b><i><i><img src="images/verbier/2.jpg"></i></i></b>
    <b><i><i><img src="images/verbier/3.jpg"></i></i></b>
</div>
<script type="text/javascript" src="js/scaler.js"></script>
<script type="text/javascript" src="js/example.js"></script>
4
  • 3
    the pathes given in the images are not absolute. And by the include you import them into your "current" location and thus the browser cant find them Commented Feb 21, 2013 at 14:48
  • Your formatting in your code example seems to have issues Commented Feb 21, 2013 at 14:48
  • 3
    Why do you have images wrapped in bold and (double'd up) italic tags? Also your images should include alt attributes for browsers which do not display images. Commented Feb 21, 2013 at 14:52
  • Check the path to images. Commented Feb 21, 2013 at 14:53

2 Answers 2

2

Your images folder must be in the same directory as the php file that is calling it. Otherwise, you must specify the relative path to the images folder.

Sign up to request clarification or add additional context in comments.

Comments

0

When you include a file, it's like if you were to copy & paste that file's contents into the PHP file.

So, it's like the PHP file is asking for images/verbier/0.jpg, which means it's looking in the same folder as the PHP file.

I suggest you edit the HTML file so it uses absolute paths to the images, like:

<img src="/menus/images/verbier/0.jpg">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.