Re: a little help here please... :)

From: Date: Fri, 01 Dec 2000 04:21:28 +0000
Subject: Re: a little help here please... :)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28165@lists.php.net to get a copy of this message
On Thu, 30 Nov 2000, Richard Lynch wrote: > > Second: > > I can't open files with absoulte paths right? like in C... > > include("/home/whatever/www/something.htm") works but > > include("/something.htm"); doesn't... altough in HTML I can link that > way... > > why is that? can someone exaplain it to me? > > In order to allow the inclusion of files outside your web-tree, PHP uses a > full pathname from the root of the whole machine when an include path starts > with "/" rather than just from the root of your web-tree. > > As a result, no, you can't use /something.htm when you want your web-rooted > file to be included. > > However, you can alter include_path in your php.ini to have your web-tree > root in it, and then something.htm would work. I also recommend having "./" > as your first entry in your include_path so files "next to" the main file > can be included. You can also include("$DOCUMENT_ROOT/something.html") Matt

« previous php.general (#28165) next »