physaux Posted November 2, 2009 Share Posted November 2, 2009 Hey guys, I was wondering if someone could advise me, here is my situation: First Question: I have my main web folder, and then 10 folders. Then in each of these 10 folders, I have 10 more folders. Ex Domain.com/F8/F1 Domain.com/F8/F2 So, I will have many pages, and they will all have similar layout. I want to do this with php include() function, the problem is that I don't know how to "reference Up a level", like say "footer.php" was located in: Domain.com/includes/footer.php How would i refer to that from say Domain.com/F8/F2/index.html Would it just be absolute path? Or is there a better way? Second Question: How can i pass the current path to a function? Like i mean, I want to have each file from each of those folders call a function like so: In file- Domain.com/F2/F3/index.html Call Function- Function(F2,F3); How can i "send" the data of the current folder in a function? This way I could have really efficient pages, because they would be generated from a database and just one easy-to-edit file. Or again, is there a better way? Thanks for any insight!! Quote Link to comment https://forums.phpfreaks.com/topic/179973-solved-how-to-reference-to-a-file-up-one-level-in-includes-function/ Share on other sites More sharing options...
Daniel0 Posted November 2, 2009 Share Posted November 2, 2009 The special directory name .. (two dots) always refers to the parent directory. Quote Link to comment https://forums.phpfreaks.com/topic/179973-solved-how-to-reference-to-a-file-up-one-level-in-includes-function/#findComment-949398 Share on other sites More sharing options...
physaux Posted November 2, 2009 Author Share Posted November 2, 2009 The special directory name .. (two dots) always refers to the parent directory. Thanks, that works! Anyone have any ideas for my second question? Quote Link to comment https://forums.phpfreaks.com/topic/179973-solved-how-to-reference-to-a-file-up-one-level-in-includes-function/#findComment-949407 Share on other sites More sharing options...
Daniel0 Posted November 2, 2009 Share Posted November 2, 2009 Have a look at the magic constants. Quote Link to comment https://forums.phpfreaks.com/topic/179973-solved-how-to-reference-to-a-file-up-one-level-in-includes-function/#findComment-949410 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.