Rpoblem with Textarea

Discussion in 'PHP' started by Fadz, Aug 2, 2007.

  1. #1
    I Want To Know About The Component of When I Submit Form Then It before data goes in database it Automatically Add The Tag Of <br> In Textarea where user press enter But on When user Submit Form
     
    Fadz, Aug 2, 2007 IP
  2. electrobooks

    electrobooks Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not too sure I understand your question but this may help.

    Try nl2br($_POST[textarea']);

    Where textarea is the name of the nametag in the textarea box.

    That adds a new line break where the user hits enter.

    Thanks

    Chris
     
    electrobooks, Aug 2, 2007 IP
  3. Fadz

    Fadz Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i write it like this
    "My name is : MR WEbsite
    iam the best: ahan
    wel Leave it"

    But it show text like this


    My name is : MR webSite iam the best: ahan wel Leave it

    its mean it enter &nbsp; tag there ,where user press enter
     
    Fadz, Aug 3, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    electrobooks is right. Have a look at the nl2br() function.
     
    nico_swd, Aug 3, 2007 IP
  5. Jezek

    Jezek Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah the solution posted should work, just test it out first.
     
    Jezek, Aug 3, 2007 IP