View Full Version : Showing line breaks in form

03-21-2010, 05:21 AM
So ive got a form, but when I add extra lines, they dont appear on the next page, example:

My input:

The cow said moo

And the dog barked


The cow said moo And the dog barked

How can I modify it so it doesnt remove the line breaks? Heres the code for fields and some PHP strip stuff:

$subject = strip_tags($_POST['subject']);

$msgtext = strip_tags($_POST['msgtext']);

<textarea name='msgtext' cols='53' rows='7'></textarea>
<input type='text' name='subject' size='70' maxlength='75' value=''>

03-21-2010, 05:25 AM
Also this is what the code is where it shows the final result:

Message:<br>".wordwrap($row['msgtext'], 100, "\n", 1)."

Len Whistler
03-21-2010, 08:16 AM
You might have to play around with the syntax.

$text = $row['msgtext']
echo nl2br($text);