Jump to content


Photo

php and textarea


  • Please log in to reply
2 replies to this topic

#1 bgp1

bgp1
  • Members
  • PipPip
  • Member
  • 11 posts
  • LocationChicago, IL, USA

Posted 31 May 2006 - 06:48 PM

Hello,

I have a form that users submit and it includes a textarea. I want it to capture the returns they put in the textarea into a mysql database. I have this much done. But, when I print the data back out, I want it to be formatted where there are returns. How can I go about doing this?


Thanks!

#2 Abbner

Abbner
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 May 2006 - 07:41 PM

while your text area is stored in the database it keeps track of the return strokes, but if you want those to apear on your webpage, you use the command to convert them to line breaks

nl2br(); should do the trick

#3 bgp1

bgp1
  • Members
  • PipPip
  • Member
  • 11 posts
  • LocationChicago, IL, USA

Posted 31 May 2006 - 10:27 PM

That worked! Thanks for the help!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users