Re: Opening a file

From: Date: Wed, 05 Sep 2007 17:01:25 +0000
Subject: Re: Opening a file
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-261741@lists.php.net to get a copy of this message
Ah, okay. Would this also work if I wanted to apply this to multiple other pages located within different areas of the site tree? On 9/5/07, Stut <stuttle@gmail.com> wrote: > > Dan Shirah wrote: > > So: > > fruits.txt is contained in the same folder as mypage.php. > > mypage.php tries to pull the data contained in fruits.txt to see if the > > data matches > > toppage.php has mypage.php inserted as an include and checks for the > > result of $a and processes accordingly. > > In that case your CWD in mypage.php is two levels above where mypage.php > is. Change the line that reads the file to... > > $lines = file(dirname(__FILE__).'/users.txt'); > > ...and it should work fine. > > -Stut > > -- > http://stut.net/ >

« previous php.general (#261741) next »