Justin from Indiana wrote:
> I'm creating a limited news database for a
not-for-profit site and I want to
> let admin users write a long entry which may include
multiple paragraphs (i.e.
> carriage returns) and even bold text for subheadings
would be nice.
Carriage returns are stored normally in a database. However,
they seem
to disappear when displayed onscreen. This is because HTML
ignores extra
whitespace. If you use View Source in a browser, you'll see
the carriage
returns are actually there. The solution is simple with PHP.
Just pass
the material retrieved from the database to nl2br().
http://docs.php.net/manual/en/function.nl2br.php
If you're using Dreamweaver CS3, you can add nl2br() to
dynamic text by
double-clicking the Dynamic Text listing in the Server
Behaviors panel,
and selecting Convert - New Lines to BRs from the Format
menu.
To store bold text in the database, just surround the text
with <strong>
tags.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/