Re: Opening a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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/
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux