[PHP] Append a line to a text file

2002-04-28 Thread Rodrigo

I need to add a email to the text file that is already written, but I
get the file writen over , so I always get only the last email send by
the form.
 
What I need is a form that get the e-mail and it writes the email at the
end of a text file.
 
Thanx,
 
Rodrigo 



Re: [PHP] Append a line to a text file

2002-04-28 Thread Miguel Cruz

On Sun, 28 Apr 2002, Rodrigo wrote:
 I need to add a email to the text file that is already written, but I
 get the file writen over , so I always get only the last email send by
 the form.
  
 What I need is a form that get the e-mail and it writes the email at the
 end of a text file.

www.php.net/fopen

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Append a line to a Text File

2002-04-28 Thread Rodrigo

I still need to know how to do it, since the a+ or the a give me
problems...
I need to be able to add a line at the end of a text file thru sending
the information (and by this I mean the e-mail to be writen) thru a
form, and this new information should be added to the file at the end of
it without overwriting it.
Thanx,
Rodrigo
 
PS: If possible send a code for instruction. ;)
 



Re: [PHP] Append a line to a Text File

2002-04-28 Thread Miguel Cruz

On Sun, 28 Apr 2002, Rodrigo wrote:
 I still need to know how to do it, since the a+ or the a give me
 problems...

What kind of problems? Do you get an error message that you can paste into
a message for us to see? Does the file get corrupted in some specific way
that you can describe? Does your computer start on fire?

 I need to be able to add a line at the end of a text file thru sending
 the information (and by this I mean the e-mail to be writen) thru a
 form, and this new information should be added to the file at the end of
 it without overwriting it.
  
 PS: If possible send a code for instruction. ;)

?

  $file_pointer = fopen('/tmp/myfile', 'a') || exit;
  $string_to_write = date('j-M-Y H:i:s') . \n;
  fwrite($file_pointer, $string_to_write);
  fclose($file_pointer);

?

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Append a line to a Text File

2002-04-28 Thread John Holmes

How about you send us your code, because you're the one doing something
wrong. a is what you want, if it's not working, then there is an error
in your code or logic. 

---John Holmes...

 -Original Message-
 From: Rodrigo [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, April 28, 2002 7:50 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Append a line to a Text File
 
 I still need to know how to do it, since the a+ or the a give me
 problems...
 I need to be able to add a line at the end of a text file thru sending
 the information (and by this I mean the e-mail to be writen) thru a
 form, and this new information should be added to the file at the end
of
 it without overwriting it.
 Thanx,
 Rodrigo
 
 PS: If possible send a code for instruction. ;)
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php