Hi,
Does anyone know what it doesn't works:
<?php
$fp=fopen("c:\\histo\\OOO\\hist.txt", "r");
echo $fp;
?>
Warning: fopen("c:\histo\OOO\hist.txt", "r") - No such file or directory in c:\program files\easyphp\www\maredsous\intranet\lecture.php on line 2
why doesn't it works
Moderator: General Moderators
have you checked file permissions on the file in question? also try something like this:
to verify that the string your passing the fopen() is indeed what you think it is.
Code: Select all
<?php
$file_name = "c:\\histo\\OOO\\hist.txt";
$fp=fopen($file_name, "r");
echo $file_name ."<BR>\n";
echo $fp;
?>chdir
You might have to change to the directory in which the file is located.
phpScott
?>
Code: Select all
chdir("c:\\histo\\OOO");
then
$fp=fopen("hist.txt", "r");?>
btw: $fp is the filedescriptor returned by fopen() not the content of the file.
Take a look at http://php.net/file and http://php.net/file_get_contents
Take a look at http://php.net/file and http://php.net/file_get_contents