You are here: Re: compile error « PHP Programming Language « IT news, forums, messages
Re: compile error

Posted by no on 12/26/06 16:32

sam wrote:
> HI ,
> whats wrong with the following code:-
> <?php
> $myFile = "test.txt";
> $fh = fopen($myFile, 'a');
>
> $add="This new stuff /n";
> fwrite($myFile,$add);
> fclose($fh);
> ?>
>
> When i run this it gave me the error:-
> Warning: fwrite(): supplied argument is not a valid stream resource
>


change fwrite line into this:
fwrite($fh,$add);

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация