jwk811 Posted November 5, 2006 Share Posted November 5, 2006 do you have to write out the full url to get a file on a script, in another folder? or is there a different way cuz i think the full url is messing things up on my pages Link to comment https://forums.phpfreaks.com/topic/26192-quick-question/ Share on other sites More sharing options...
JasonLewis Posted November 5, 2006 Share Posted November 5, 2006 you can just access it by entering the path to it, not the full url.example. you have a folder layout like this:rootindex.phpinclude.txt +-- members +-- index.php +-- forumand on index.php you want to include a file from the root directory simply go:[code=php:0]include '../include.txt';[/code]just remember that ./ gets the folder you are in, so add another dot to get the next folder down. then to get more folders i am pretty sure you have to add a / then 2 more dots to get the next folder. like this.[code=php:0]include '../../include.txt';[/code]this wat get a file from the directory below root if there was one.i think i made it clear...good luck Link to comment https://forums.phpfreaks.com/topic/26192-quick-question/#findComment-119797 Share on other sites More sharing options...
jwk811 Posted November 5, 2006 Author Share Posted November 5, 2006 yes! thank you very much! it works! Link to comment https://forums.phpfreaks.com/topic/26192-quick-question/#findComment-119805 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.