[clue-tech] I'm blind, or why is this PHP fwrite() failing?

Matt Gushee matt at gushee.net
Sun Sep 25 20:08:36 MDT 2005


Jed S. Baer wrote:

>     $ptologfile = fopen('/tmp/contactlog.txt', 'a') || die ("Can't open
> logfile");
>     if (is_writable('/tmp/contactlog.txt')) echo '<b>Writeable</b><br>';
>     $junk = 'junk';
>     fwrite($ptologfile, $junk) || die ("Can't write to logfile");

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

This is just a shot in the dark, but does it make a difference if you do 
  the 'if' statement *before* opening the file? It shouldn't matter, I'm 
sure, but if by chance it does ... it might be instructive.

--
Matt Gushee
Englewood, CO, USA
_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list