How to Get Input From Textarea in PHP

How to get input from textarea in php - Object form textarea used to create text input that can accommodate more than 1 line input. The textarea tag is similar to the text type input tag, but has the advantage of holding multiple rows. Usually textarea is used for long input, such as comments, captions, or notes. To understand more about textarea in php, here I give examples of application of text area in a program.
Program 1
File Name: input09.php
Description: The program displays the input form criticism and suggestions with the text area.
Open notepad, then type the following html program code.
<html>
 <head><title>Criticism and Feedback ~ Input
Textarea</title></head>
<body>
  <FORM ACTION="proses09.php" METHOD="POST" NAME="input">
   <h2>Critique Input / Feedback :</h2>
<textarea name="suggestion" cols="40"
rows="5"></textarea><br>
   <input type="submit" name="Proses" value="Input
Suggestion">
</FORM>
</body>
</html>

How to get input from textarea in php

Save the php program code into the htdocs folder named input09.php
Program 2
File Name: process09.php
Description: Program to display the contents of the criticism/ suggestion in accordance with the input text area in program 1.
Type the following php program code into notepad.
<?php
if (isset($_POST['Proses'])) {
$suggestion = nl2br($_POST['suggestion']);
 echo "Your Criticism / Advice is : <br>";
echo "<font color=blue><b>$suggestion</b></font>";
}
?>

How to get input from textarea in php

Save the php program code into the htdocs folder named process09.php.
Explanation of Programs 1 and 2 (how to get input from textarea in php)
Program 1 will display a suggested critique form using the text area (see picture). To create an input type combo box, can use <textarea> tags. In contrast to typetext input that can only input one line, in the text area, can input more than one line. View image. To retrieve the value (value) of form textarea type, can directly access it according to its name. Watch the 2nd row program!.
To display the result, open the browser then in the address bar type http://localhost/input09.php then enter. Then the results will appear as follows.
How to get input from textarea in php
Program View

How to get input from textarea in php
Program View

That is the tutorial how to get input from textarea in php from me. Hopefully these tutorials can add to our knowledge of the php programming language. Learn also tutorial about: How to Get Selected Item From Combobox in PHP.

Comments