[thelist] PHP Includes not including

Maximillian Schwanekamp lists at neptunewebworks.com
Wed Jan 5 01:16:22 CST 2005


Rich Points wrote:
> Howdy,
> I'm trying to use PHP includes for common elements like a  header and 
> footer throughout a site and I'm having trouble. <snip />
> <?php include("inserts/header.php"); ?>
> 
> I've also tried
> 
> <?php include("/inserts/header.php"); ?>
> <?php include "/inserts/header.php"; ?>
> <?php include("full_absolute_path/inserts/header.php"); ?>
> <?php include("/full_absolute_path/inserts/header.php"); ?>

If the path to script you're using include() in is:
/opt2/home3/rd6714/public_html/articles_2005/1_subhead.php
...and assuming your header.php is:
/opt2/home3/rd6714/public_html/inserts/header.php
...then your include statement in 1_subhead.php could functionally be:

<?php include('../inserts/header.php'); ?>
OR
<?php include '/opt2/home3/rd6714/public_html/inserts/header.php'; ?>
(with or without parentheses, to taste).

If that doesn't work, you might double-check that your include_path ini 
setting includes your account's path somewhere, and adjust as 
necessary/possible.  cf:
http://us3.php.net/manual/en/ini.sect.path-directory.php#ini.include-path

-- 
Maximillian Von Schwanekamp
Dynamic Websites and E-Commerce
NeptuneWebworks.com <http://www.neptunewebworks.com/>
voice: 541-302-1438
fax: 208-730-6504




More information about the thelist mailing list