PHP Tutorial - PHP Form Textarea

A text area field is similar to a text input field, but it allows the user to enter multiple lines of text.

Unlike most other controls, an initial value is placed between the <textarea> ... </textarea> tags, rather than in a value attribute.

A textarea element must include attributes for the height of the control in rows (rows) and the width of the control in columns (cols):

<label for="textAreaField">A text area field</label> 
<textarea name="textAreaField" id="textAreaField" rows="4"  cols="50"></textarea> 


Name the following script as index.htm. It has a text area and a submit button.

   <form action="index.php" method="get">
      <textarea name="address" rows="5" cols="40"></textarea>
      <input type="submit" value="hit it!" />

Name the following script as index.php. It reads the value from the textarea from the form above.

   print "Your address is: <br/><b>" . $_GET ['address'] . "</b>";