|
Posted by Toby A Inkster on 02/16/07 09:52
dorayme wrote:
> <?php include ($_SERVER['DOCUMENT_ROOT'].'/includes/footer.inc'); ?>
Unless you're moving files about *a lot*, or you enjoy including files
that include files that include files... just use relative paths. Easy.
<?php include './../../includes/footer.inc'; ?>
Personally, I prefer to create an includes directory, put it wherever the
hell I like (perhaps even outside the document root!) and include files
like this:
<?php include 'footer.inc'; ?>
So how does PHP know where footer.inc is kept? By setting the
"include_path" setting in "php.ini", ".htaccess", "httpd.conf"
or similar. Of course, if you are on shared hosting, you may
need to check that it is possible for you to adjust the
include_path.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|