[Project_owners] PHP include on mozdev.org

Chris Neale cdn at mozdev.org
Sat Apr 29 01:21:14 EDT 2006


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/ ]


More information about the Project_owners mailing list