Posted 28 June 2006 - 08:33 PM
How can I use fopen function to open this txt file if I don't want to give specific path to this txt file?
Posted 28 June 2006 - 08:34 PM
$file = './sometextfile.txt';
if ($open = fopen($file, 'r'))
The 'r' is for read, 'w' is for write and 'x' is for both I believe, check out the specifics at php.net/fopen
Posted 28 June 2006 - 08:48 PM
So how to use the same fopen function if txt file is in folder which is "in higher level" (for example there's folder 'folder1' which includes 'file1.txt' and 'folder2'; and folder2 includes 'file1.php')?
I still don't want to give specifc path to the txt file.
Posted 28 June 2006 - 08:52 PM
./ = current directory
../ = the directory above you
./somedirectory/file.php = get file.php in the directory somedirectory which is in the same directory as you
../somedirecotry/file.phhp = get file.php in the directory somedirectory which is in the directory above yours
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users