17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 967 Views |
-
Opening a text file from a php file

2 August 2008 at 2:45am
Ok, so I have a php file in the Code folder, it has a corresponding template etc..
from the php file I want to open and read a text file.
as in
$file = 'filename.txt';
$data = file($file) or die("Failed");it can't seem to find the text file
help please!!!
-
Re: Opening a text file from a php file

2 August 2008 at 6:29am
You'll be looking in the wrong folder.
Use "echo getcwd();" to find where you're looking.
http://nz.php.net/manual/en/function.getcwd.phpThen put in the correct relative or absolute path to the file.
| 967 Views | ||
|
Page:
1
|
Go to Top |


