orange22 wrote:
> Why does this happen? Is there a way round this so I can
just have the simple
> text area that can handle paragraphs?
If you switch to source view in the browser, you will see
that the new
lines are there. However, HTML ignores excess whitespace and
new line
characters. That's why your paragraphs don't show up.
There are two ways around this:
1. Use nl2br() to format the output. This converts the new
line
characters to <br /> tags. If you're using Dreamweaver
CS3, you can
select Convert - New Lines to BRs from the Format menu in the
Dynamic
Text dialog box. In earlier versions of DW, you need to
hand-code it.
Just surround the variable containing the article like this:
echo nl2br($row_recordsetName['article']);
2. The alternative is to place opening and closing <p>
tags at the
beginning and end of the article. Then use str_replace() to
replace
every pair of double new lines with </p><p>.
<p><?php echo str_replace("\n\n",
'</p><p>',
$row_recordsetName['article']); ?></p>
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/