File operations problem
Posted: Wed Jun 22, 2005 12:52 pm
All,
I get the following message:
Warning: fread(): supplied argument is not a valid stream resource in C:\program files\Apache Group\Apache2\htdocs\filehandle2.php on line 4
Warning: fclose(): supplied argument is not a valid stream resource in C:\program files\Apache Group\Apache2\htdocs\filehandle2.php on line 5
The code is
<?
$myFile = "test.txt";
$fh = fopen($myfile, 'r');
$theData = fread($fh,3);
fclose($fh);
?>
I have verified that the file test.txt exists and has some text in that. But I don't know why the above error message is appearing.
Could someone else.
I get the following message:
Warning: fread(): supplied argument is not a valid stream resource in C:\program files\Apache Group\Apache2\htdocs\filehandle2.php on line 4
Warning: fclose(): supplied argument is not a valid stream resource in C:\program files\Apache Group\Apache2\htdocs\filehandle2.php on line 5
The code is
<?
$myFile = "test.txt";
$fh = fopen($myfile, 'r');
$theData = fread($fh,3);
fclose($fh);
?>
I have verified that the file test.txt exists and has some text in that. But I don't know why the above error message is appearing.
Could someone else.