Re: Problem appending data in a file with fopen("ftp://...","a")
| From: | Kurt Lieber | Date: | Mon, 29 Oct 2001 04:32:56 +0000 |
| Subject: | Re: Problem appending data in a file with fopen("ftp://...","a") | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72679@lists.php.net to get a copy of this message | ||
On Sunday 28 October 2001 07:29 pm, you wrote:
> I only fopen my file once...
>
> My program checks if there is a specific session cookie. If not (it's a
> new user that browse the site) I set a cookie and try to store the unique
> ID of this user (other cookie) in a file with a timestamp to track which
> user came and when (+ nb of times...). That's where I use my fopen() then
> I fclose the file. The fopen("...", "a") creates the file if it's not
> already there but once it's created, it cannot append a new line
> (User;timestamp) to this file : "Error : File exists".
Aha -- I understand. I also didn't see the first time that you're using FTP.
You can't fopen() a file for read/write through FTP. You can do one, or the
other, but not both.
http://www.php.net/manual/en/function.fopen.php