Re: nl2br too?
| From: | gamin | Date: | Thu, 16 Jan 2003 16:37:34 +0000 |
| Subject: | Re: nl2br too? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131891@lists.php.net to get a copy of this message | ||
"Chris Shiflett" <shiflett@php.net> wrote in message
news:20030116155612.86000.qmail@web14306.mail.yahoo.com...
> --- 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
Condier using mysql_escape_string() before inserting into your table to
protect your database server from simple attacks
g