Help with HTML form?

Discussion in 'PHP' started by Vewgle, Jun 13, 2006.

  1. #1
    I have my user fill in an html form then it sends it to submit.php using
    $FormContents = $_Post['Form'];
    Code (markup):
    But when I display it ( what the user entered ), it will take all the paragraphs and formatting out of what the user submitted. Any suggestions?
     
    Vewgle, Jun 13, 2006 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your problem comes down to this: when the user enters the text, the form uses newline characters when the user presses enter. When you return the newline character to the browser, it's ignored as a new line character means nothing in HTML.

    Try:
    $FormContents = nl2br( $_Post['Form'] );

    instead.
     
    TwistMyArm, Jun 13, 2006 IP
    Matts likes this.
  3. Vewgle

    Vewgle Active Member

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    Thank you so much twist it worked perfect!!
     
    Vewgle, Jun 13, 2006 IP