compile error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
HI ,
whats wrong with the following code:-
$myFile = "test.txt";
$fh = fopen($myFile, 'a');

$add="This new stuff /n";

When i run this it gave me the error:-
Warning: fwrite(): supplied argument is not a valid stream resource

Re: compile error

sam wrote:
Quoted text here. Click to load it

change fwrite line into this:

$myFile was just a file name.
you need to pass the open file likn to fwrite funciton.

Site Timeline