Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read from a form's textarea into a file with PHP 1

Status
Not open for further replies.

leegold

Technical User
Mar 19, 2002
39
US
Can I read from a form's textarea into a file in one "swoop", what's the cleanest way in PHP? Say that I've already created an empty file on my drive for this purpose and I'm using POST to get the textarea txt from the hmtl form to the processing .php file. Thanks, Lee G.
 
Assume the name of the textarea field is "foo". When the form is submitted, $_POST['foo'] will contain the entered string.

Open the file using fopen() and write the variable's value to the file using fwrite()


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
mysql> describe page;
+----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+----------------+
| page_id | int(10) unsigned | | PRI | NULL | auto_increment |
| page_url | varchar(200) | | | | |
| title | varchar(200) | | | | |
+----------+------------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top