Re: Writing to a file
| From: | Gonzalo Vera | Date: | Fri, 11 Aug 2000 14:30:50 +0000 |
| Subject: | Re: Writing to a file | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1741@lists.php.net to get a copy of this message | ||
From the user manual (XVII. Filesystem functions - fopen):
-------------------------------------
If you are experiencing problems with reading and writing to files and
you're using the server module version of PHP, remember to make sure
that the files and directories you're using are accessible to the
server process.
On the Windows platform, be careful to escape any backslashes used in
the path to the file, or use forward slashes.
$fp = fopen("c:\\data\\info.txt", "r");
-------------------------------------
Is your file accesible? Is your path correct? Maybe a little more info
would help.
Gonzalo.
> Hi all, I wonder if anyone can help.
> I am trying to take text from a text area in a web page and write that text
> into a file on a webserver. That didn't work so I just tried to simply write
> a string specified below directly into the file just to see if that would
> work
> I am using this code but it isn't working and when I check the file it
> remains unmodified even the date last modified hasn't changed.
> Help would be appreciated,
> Thanks,
> Hatim.
> $newHTMLfile = fopen($newHTMLfilePath,"w+");
> fwrite($newHTMLfile, "New text to add to file.");
> fclose($newHTMLfile);
> echo "new text should be written to file.";
Gonzalo.