Jump to content

[SOLVED] How to reference to a file "up one level" in "includes()" function???


physaux

Recommended Posts

 

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!!

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.