Re: About function Include

From: Date: Sun, 04 Feb 2001 01:11:42 +0000
Subject: Re: About function Include
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38036@lists.php.net to get a copy of this message
> I've been using the funcion INCLUDE like this: > <?include"("/header.htm");?> because file header.htm has to be included > in a lot of files. I want to use "/" because file header.htm is in main > directory (like E:) and there are files in very directories above E:. > But when I have a file in a directory above, like E:folder1/index.html > and I use the include function in the file index.html, there's next > error massage: Warning: Failed opening '/header.htm' for inclusion > (include_path='') in /home2/httpd/htdocs/www/index.html on line 21 . > Line 21 is the line I had put include function. > We don't want to use <?include("../header");?> because we have files in > other directories, and like that, we had to use > <?include("../header");?> in one file, > <?include("../../header");?> in > another one, etc.What can we do? You can provide a full path using "/home2/httpd/htdocs/www/header.htm" Or, you can set your include path to be "./:/home2/httpd/htdocs/www/:/any/other/directory/you/like"; in php.ini -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#38036) next »