Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-21-2010, 04:21 AM   PM User | #1
Scowen
New to the CF scene

 
Join Date: Mar 2010
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
Scowen is an unknown quantity at this point
Smile Showing line breaks in form

So ive got a form, but when I add extra lines, they dont appear on the next page, example:

My input:
Code:
The cow said moo

And the dog barked
Result:
Code:
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:
Code:
  $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=''>
Scowen is offline   Reply With Quote
Old 03-21-2010, 04:25 AM   PM User | #2
Scowen
New to the CF scene

 
Join Date: Mar 2010
Posts: 8
Thanks: 2
Thanked 0 Times in 0 Posts
Scowen is an unknown quantity at this point
Also this is what the code is where it shows the final result:

Code:
Message:<br>".wordwrap($row['msgtext'], 100, "\n", 1)."
Scowen is offline   Reply With Quote
Old 03-21-2010, 07:16 AM   PM User | #3
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
You might have to play around with the syntax.

PHP Code:
$text $row['msgtext']
echo 
nl2br($text); 




-------
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Reply

Bookmarks

Tags
help php form html tag

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:37 PM.


Advertisement
Log in to turn off these ads.