Amezis 0 Report post Posted July 25, 2005 Well, I'm new to PHP, and I get tons of problems when I use the include tags:Let's say my site is http://www.mysite.com/, and the menu is http://forums.xisto.com/no_longer_exists/. The site I want to include menu.htm in is not in the same folder as menu.htm, but in "folder2": http://forums.xisto.com/no_longer_exists/ images in menu.htm are located in it's own folder: http://www.mysite.com/ images. However, when I load index.php with <?php include '../menu.htm'; ?>, the images won't load. Then I try to check the image location and it says that the images that didn't load was located in http://www.mysite.com/ folder2/images/ Why do it change folder? And how can it be fixed? Share this post Link to post Share on other sites
rvalkass 5 Report post Posted July 25, 2005 The image paths in menu.htm are just /images/image.jpg As this is a relative path it will look for a folder called images inside whatever folder it is in. If you give FULL paths to all your images then it will work. E.g.: http://forums.xisto.com/no_longer_exists/ is a full path. Share this post Link to post Share on other sites
Amezis 0 Report post Posted July 25, 2005 If there's not any other ways, I'll do that... Share this post Link to post Share on other sites
snlildude87 0 Report post Posted July 25, 2005 The image paths in menu.htm are just /images/image.jpg As this is a relative path it will look for a folder called images inside whatever folder it is in. If you give FULL paths to all your images then it will work. E.g.: http://forums.xisto.com/no_longer_exists/ is a full path. 165431[/snapback] Umm, /images/image.jpg won't work when you're dealing with relative paths in php. Try this code: <?php include("/home/[cpanel login name]/public_html/menu.htm"); ?That will be your include code for menu.htm. Replace [cpanel login name] with your cpanel login name. If you need anymore help, PM me. Share this post Link to post Share on other sites
truefusion 3 Report post Posted July 25, 2005 Since you are including a file found in another folder, different where the index.php file is, you're gonna have to change the images path in menu.htm from whatever it is and add "../" to the begining. Since index.php is in folder "folder2", and in menu.htm says the images are in the images folder, and the menu.htm is being included in index.php, php thinks that you are trying to load images founded in "folder2/images/". I hope this make sense to you. Share this post Link to post Share on other sites