[Project_owners] PHP include on mozdev.org

Eric H. Jung grimholtz at yahoo.com
Fri Apr 28 17:58:00 EDT 2006


OK, that works, but why do I have to do that at all? All of the hosting
companies I've used so far work with relative paths in PHP. Is it a web
server/PHP configuration specific to mozdev.org?


--- Chris Neale <cdn at mozdev.org> wrote:

> On Friday 28 April 2006 22:35, Eric H. Jung wrote:
> > Hi,
> >
> > I have the following directory structure for a mozdev site:
> >
> > www/includes/
> >   header.php
> >   footer.php
> >   ...
> >
> > www/proto
> >   test1.html
> >   test2.html
> >   ...
> >
> > In test1.html, when I write:
> >
> > <?php include "../includes/header.php"; ?>
> >
> > I get the error:
> >
> > Warning: main(../includes/header.php): failed to open stream: No
> such file
> > or directory in
> > /mozdev/sandbox/data/helm/htdoc/foxyproxy/www/proto/test1.html on
> line 1
> >
> > What am I doing wrong? The include works for HTML files at the www/
> > directory:
> >
> > <?php include "includes/header.php"; ?>
> >
> > Thanks for any help,
> > Eric
> >
> 
> How about
> include(substr(dirname(__FILE__),0,strrpos(dirname(__FILE__), 
> '/')) . '/includes/header.php') ?
> 
> -- 
> 
> cdn
> 
> --
> 
> feedback -at- mozdev -dot- org is for comments *not* about a specific
> project
> 
> http://gifts-for-free.co.uk
> 
> Extensions for Mozilla-based Applications [ http://cdn.mozdev.org/ ]
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 



More information about the Project_owners mailing list