[SOLVED] What does this mean?

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
angelena
Forum Commoner
Posts: 53
Joined: Mon Nov 22, 2004 4:10 am

[SOLVED] What does this mean?

Post by angelena »

Hi...

Can anyone please tell me what the following error mean?

"fwrite(): supplied argument is not a valid stream resource"
"fclose(): supplied argument is not a valid stream resource"

Thanks alot ya..
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the handle you supplied is invalid; i.e. not a file resource.
angelena
Forum Commoner
Posts: 53
Joined: Mon Nov 22, 2004 4:10 am

Post by angelena »

Thanks for replying me,but still im bit confuse how shud this error be handle,can u pls explain more detail to me..really appreciate for your help ya.
Following is the part of the code where the error is about:

Code: Select all

$file_mess="ask.txt";
$apri_file=fopen($file_mess,'a+');
fwrite($apri_file,$comment);
fclose($apri_file);
Header("Location: $url");

feyd | Please review how to post code using

Code: Select all

and

Code: Select all

tags. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

try doing a var_dump() of $apri_file immediately following fopen() .. Also, check your error logs to be sure that no other errors are being thrown.
angelena
Forum Commoner
Posts: 53
Joined: Mon Nov 22, 2004 4:10 am

Solved

Post by angelena »

ohh..thankss a lot for ur help,the probs is now solved.

Have a nice day ya :D
Post Reply