problem with fread

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
winsonlee
Forum Commoner
Posts: 76
Joined: Thu Dec 11, 2003 8:49 pm

problem with fread

Post by winsonlee »

some how i just couldnt figure out whats wrong with this code. i follow the example exactly as how it it. but i still get this error.

Warning: fread(): supplied argument is not a valid stream resource in C:\Web\project\dropdown.php on line 27

Warning: fclose(): supplied argument is not a valid stream resource in C:\Web\project\dropdown.php on line 28

Code: Select all

$myFile = "member.txt";
$fh = fopen($myfile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

fopen() failed.
Post Reply