Re: nl2br too?
| From: | Chris Shiflett | Date: | Thu, 16 Jan 2003 15:56:12 +0000 |
| Subject: | Re: nl2br too? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131885@lists.php.net to get a copy of this message | ||
--- Cesar Aracena <icaam@icaam.com.ar> wrote:
> When I make a form in a web site for a visitor to
> send me some comments, I use nl2br() to put things
> like line breaks and see what the visitor wants me
> to see.
>
> But what happens if I have a web form to input some
> text into a TEXT cell in MySQL and want to retrieve
> it like I wrote it?
My advice is to store in MySQL exactly what the user types.
This way, you can decide when you retrieve this data
whether you want to display it on a page (in which case you
would use nl2br) or display it in a text field for editing
(in which case you would leave the data raw).
Chris