how to store /n and /r from textarea on form in database

When you want to preserve linefeeds and or carriage returns (/n, /r/n, /r)
from textarea and store it in a database.
I don't want to store a
in the database.
I do want to have the choice of replacing /n and /r with a
when
displaying the data in browser, i guess this is what nl2br is for ? But
according to the comments on the phpmanual the nl2br function isn't that
good.
So what do u do when u want to store text with linefeeds and carriage
returns in database (or do u have to do nothing) ?
What with é, ç à, ö, ...
That's for trusted input by myself, what with input by others ... strip
html-tags and script-tags ?

thanx,

Pugi!
reply [ Mi, 03 Mai 2006 11:14 ] [ ID #1299567 ]

Re: how to store /n and /r from textarea on form in database

Pugi! wrote:
> So what do u do when u want to store text with linefeeds and carriage
> returns in database (or do u have to do nothing) ?

You don't have to do anything, linefeeds can easily go in a database.

Grtz,
--
Rik Wasmus
Rik [ Fr, 05 Mai 2006 12:26 ] [ ID #1302631 ]
PHP » alt.php.sql » how to store /n and /r from textarea on form in database

Vorheriges Thema: Is it okay to reuse objects or create new ones everytime....
Nächstes Thema: looking for a php search engine that will spider protected pages