taaron12 Posted February 21, 2010 Share Posted February 21, 2010 Hi guys! I'm still trying to think of how I want to phrase my question, so please bare with me. Also mods, if this is better posted in the PHP section, please move. I've made a shared folder for my site, containing the common/shared aspects of the site, located in Root. Menu, advertisement codes, added to the page by with <?php include ('..shared/menu/menu.php');?> for example. It works on the main page of my site, and the top of the sub-domain. but if I try an include on a page that's located like: sub-domainfolder/folder/.html, or subdomainfolder/folder/folder/.html I get this. Warning: include(../../shared/menu/menu.php) [function.include]: failed to open stream: No such file or directoryAny idea how to fix this, or should I just keep all my .html files at the subdomain level? Thanks! Link to comment Share on other sites More sharing options...
boen_robot Posted February 21, 2010 Share Posted February 21, 2010 Do you mean <?php include ('../shared/menu/menu.php');?> while your main PHP script is at (for example) domain-folder/index.php and that works, but <?php include ('../../shared/menu/menu.php');?> where the main script is at domain-folder/sub-domainfolder/folder/index.php doesn't work?If that's the case, you're missing one more additional ".." to cater for the folder below your "domain-folder" folder. Link to comment Share on other sites More sharing options...
taaron12 Posted February 21, 2010 Author Share Posted February 21, 2010 Do you mean<?php include ('../shared/menu/menu.php');?> while your main PHP script is at (for example) domain-folder/index.php and that works, but <?php include ('../../shared/menu/menu.php');?> where the main script is at domain-folder/sub-domainfolder/folder/index.php doesn't work?If that's the case, you're missing one more additional ".." to cater for the folder below your "domain-folder" folder. Ahh, I see. So, the extra ".." will account for how deep the file is, and just add for how deep it goes? appreciate it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.