Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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=''>

  • #2
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Also this is what the code is where it shows the final result:

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

  • #3
    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
    You might have to play around with the syntax.

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




    -------
    Leonard Whistler


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •