Re: Opening a file

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

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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