[thelist] Tiny Problem

Jay Blanchard jay.blanchard at niicommunications.com
Tue Oct 15 13:06:00 CDT 2002

Just a quick question, and it's really daft but it's bugging me, in
an input area of a form, say a large "textarea" when anyone makes a carriage
return {like at the end of a paragraph) and then they send the information,
when it renders back from the MySQL table where it's stored, the carriage
returns are never present.

So at the moment when anyone enters any info and want's to end a paragraph
and start a new one, it's a case of adding <BR><BR>, is there a way to get
around this? (using PHP).

There are new line (\n) characters and there wil be 2 in a row (\n\n) when
the person hits two 'enters' to break the paragraphs in the text area. Use
an eregi_replace() to replace this with either two breaks (<br><br>) or you
can actually use <p> tags like this in your template;

//get data from database for $textarea
do the eregi_replace subbing '</p><p>' every time there are two newlines




More information about the thelist mailing list