Jump to content


Photo

Retaining carriage returns upon db entry


  • Please log in to reply
2 replies to this topic

#1 Rich464

Rich464
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 08 June 2006 - 06:24 PM

Hi there,

I'm having a (noobish) problem that I hope someone can help with.

I have written a small script to insert information from a form and insert it into the database, which seems to work fine, and I can get another page to echo out the information. The problem I'm having is I'm using a textarea tag on my form and it doesn't retain any of the carriage returns when the contents of the text area are submittedby the form so when I echo the information out of the database on another page, its all on one line.

I know why it does this but can't really think of a way around this. Anyone got any ideas, constructive help is much appreciated.

Thanks in advance
Rich [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 08 June 2006 - 06:36 PM

The newlines are retianed, They are just not shown as html's < br / > tag. Take a look at [a href=\"http://php.net/nl2br\" target=\"_blank\"]nl2br[/a]().

#3 Rich464

Rich464
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 08 June 2006 - 06:47 PM

oh man! your a star!

Thanks for the quick turnaround, works perfectly

appreciated :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users