Jump to content

auto_prepend_file / auto_append_file


rpieszak

Recommended Posts

Hello all,

 

My sites are hosted on Yahoo, and they have the following settings...

 

auto_append_file = common_footer.inc

auto_prepend_file = common_header.inc

include_path = .:/include:/usr/lib/php

 

If I put the common_footer.inc and common_header.inc into the root of the website, and browse to a root page, it works fine.  But if I browse to any subfolders, it can't find them.

 

What am I missing?  Doesn't it defeat the purpose if you have to put these files in every directory?

 

Any insight would be greatly appreciated.

 

Thanks,

Ryan

Link to comment
Share on other sites

If you have those files in the root of your directory, your code needs to point to those files all of the time. For example in your case since those files are in the root of your website (/) then you need to make sure you code points to the root of your website. If you just do an include with those files on each page, you're trying to tell PHP that the files are in the CWD and it won't be able to find them. Basically, just add the slash in front of the code (so instead of "include 'common_footer.php' make it "include '/common_footer.php'")

Link to comment
Share on other sites

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.