[PHP] text file reading and overwrite

2003-02-24 Thread Michael P. Carel
Hi,

Have a problem in reading a text file and displaying it in a text box
area,also what function should i used to overwrite an existing text file.

mike


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



Re: [PHP] text file reading and overwrite

2003-02-24 Thread Patrick Teague
 Have a problem in reading a text file and displaying it in a text box
 area,also what function should i used to overwrite an existing text file.

For textarea type text boxes, use the following -

textarea$var/textarea

Please note that if you  include *any* kind of spaces or tabs or other
characters between the textarea tags that it will dump them into the text
area as well.  i.e. -

textarea
$var
/textarea

The 'action' file of the form will receive the following (unless the
contents are modified of course) - \n$var\n

For input type text boxes, use the following -

input type='text' value='$var' /

As to reading a file, see Example 1 under fgets().  For deleting files, see
unlink().

Patrick

p.s. you'll want to html encode $var before dumping it into either one of
these or else the contents of $var could mess up the html in the page.



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



RE: [PHP] text file reading and overwrite

2003-02-24 Thread Matt Honeycutt
I can't tell you anything about your problem without knowing what's
going on (error messages are helpful).  As for overwriting a file, just
use: fopen($filename,w);

The w option tells it to open the file for writing and to truncate it
to zero-length.

---Matt, XPODesigns.com

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 24, 2003 7:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] text file reading and overwrite

Hi,

Have a problem in reading a text file and displaying it in a text box
area,also what function should i used to overwrite an existing text
file.

mike


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





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