[thelist] writing to file in php problem

Mike Migurski mike at saturn5.com
Mon Jan 6 16:55:01 CST 2003


>have this simple code:
>-----------------------------------
>$filename = "myfile.php";
>
>$body  = "<html></html>";
>
>$handle = fopen($filename,'w+');
>$string = $body;
>fputs($handle, $string);
>fclose($handle);
>-----------------------------------
>That's all that is there..won't work. Keep getting an empty file
>(nothing is written). This exact code works in other pages I
>have..any ideas?

Hard to say without more info - the file gets created? It turns up empty?
What's the return value of fputs()?

I tried it here, and of course it worked fine. What are the permissions of
the directory you're in?

-mike.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
                 http://www.saturn5.com/mike/contact.html

                "Freedom! Horrible, horrible freedom!"







More information about the thelist mailing list