black.horizons Posted September 28, 2006 Share Posted September 28, 2006 do included files assume the directory position of the file from which they're included.e.g.website/includes/header.php - has links to ../index.htma file links.php resides inwebsite/links.phpif links.php includes /includes/header.php with a link to index.htm, will the link work, or not? Quote Link to comment https://forums.phpfreaks.com/topic/22388-php-includes/ Share on other sites More sharing options...
HuggieBear Posted September 28, 2006 Share Posted September 28, 2006 It's a simple enough test to try :)But yes, relevant to the calling doc, not the included doc I believe.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/22388-php-includes/#findComment-100331 Share on other sites More sharing options...
wildteen88 Posted September 28, 2006 Share Posted September 28, 2006 The included files become part of the file including them.So if you included header.php from the includes folder into links.php which is in the website folder then all paths from header.php go from the website folder and not the lincludes folder. Quote Link to comment https://forums.phpfreaks.com/topic/22388-php-includes/#findComment-100332 Share on other sites More sharing options...
black.horizons Posted September 28, 2006 Author Share Posted September 28, 2006 thats what i thought, just i have a lot of sub folders, so for the subfolders i'll have to modify the header.php, and add an extra ../ to every a href. not so bad, unless there's something else i can do? Quote Link to comment https://forums.phpfreaks.com/topic/22388-php-includes/#findComment-100334 Share on other sites More sharing options...
hopeless Posted September 29, 2006 Share Posted September 29, 2006 Setting the absolute path at the top of every page seems to work for us - we then just have all inlcudes in one folder (same with scripts etc) and it yanks them out and works out he path. Quote Link to comment https://forums.phpfreaks.com/topic/22388-php-includes/#findComment-100604 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.