|
Hi all,
I'm new to php and trying to design my first site with it. My basic template uses includes for the header and footer, but what I'm confused about is using that same template in other directories.
If index.php is in the root folder, along with header.php (which includes all the relative links to my CSS files and so on), how can I use that same template for a folder in say, root/directory2/?
The problem I run into is, I can change the relative paths to the include files, IE: <? include ('../header.php'); ?> ... but I still have the issue of then the CSS links are wrong when they're brought into that directory.
I'm not sure if that makes sense... but basically I can't figure out an easy way to manage these files in other directories and it seems like just putting all the files in the root would be easiest -- though that's not optimal.
Is there a way to do this without using absolute paths to files or putting all the pages using the template in the root?
Thanks in advance!
|