Jump to content

Recommended Posts

I have one layout page that all directories use on my website. How can I make it so that no matter where the file is, the server will always include it. I cannot use direct paths because php will not allow it, and I can't specify the directory for each file. Example.

 

Layout.php includes files/header.php which includes lib/main.lib.

 

in Pages/Path/index.php I include ../../Layout.php. Than Layout.php's includes are all messed up

 

If you can make sense of me, please help

If your pages include your layout page, then include the file in the layout page. I have struggled with this as well.

 

All my pages in every site I build look like this...

 

<?php include('header.php') ?>


SOme Content here


<?php footer() ?>

 

In my include page, I generally have this line

 

include('etc/includes.php')

 

 

This makes all my pages have access to the includes file which contains sitewide functions and other items.

 

Hope this helps ya a little

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.