taaron12 Posted February 21, 2010 Report Share Posted February 21, 2010 (edited) 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! Edited February 21, 2010 by taaron12 Link to comment Share on other sites More sharing options...
boen_robot Posted February 21, 2010 Report 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 Report Share Posted February 21, 2010 (edited) 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. Edited February 21, 2010 by taaron12 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now