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
https://forums.phpfreaks.com/topic/44218-auto_prepend_file-auto_append_file/
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'")

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.