I am trying to make my text area to print the same exact message i wrote in the text area(it’s always printed in one line only). i tried some techniques i gathered from watching and reading but none of them work, i’ve been trying to make it for 2 days already. I’m newbie to php hope you guys can help me, thank you in advance.
Here is my code:
<textarea name="comment" rows="5" cols="120" wrap="virtual" nl2br () ></textarea>
$commentVar = $_POST["comment"];
echo "Comment: <br>". $commentVar;
>Solution :
Like Markus Zeller said, nl2br must be used in PHP to echo the POST input from the form:
$commentVar = $_POST["comment"];
echo "Comment:". nl2br($commentVar);