@NogDogDec 08.2010 — #The leading slash in this case -- for a file system path -- does not mean the same thing as in HTML, where it would indicate a path relative to the web root directory. If that is your intention, then: [code=php] $handle = fopen($_SERVER['DOCUMENT_ROOT'] . '/myfile1/filename.txt', 'r'); [/code] If, instead, you mean relative to the directory of the current script, then just use you code without the leading "/" in the path.
@ChipzzzDec 18.2010 — #What if this file is outside public_html using $_SERVER['DOCUMENT_ROOT'] ?
$_SERVER['DOCUMENT_ROOT'] will be direction to public_html.
Is this possible or I have to use simple /home/.../.../[/QUOTE]
You have many alternatives... among them are: [code=php] 'home/.../.../'; '~/.../.../'; $_SERVER['DOCUMENT_ROOT'] . '/../../upTwoLevels/somewhereOutsideTheWebsite/someFile'; [/code]
Anything that translates to a valid path within the operating system is ok.