|
Posted by kenoli on 12/27/07 22:52
I would like to allow an admin user to enter line returns or html tags
in a text area, store them in a mysql table and then retrieve them and
display them in a web page as formatted text, e.g.:
\n\n becomes <p>
\n becomes <br/>
<ul> remains <ul>
etc.
I've played around with str_replace(), mysql_real_escape_string(),
nl2br() and can't get it to all work together.
There is obviously both the issue of getting the data into the
database and then getting it out again and translating (or preserving)
the data into html.
I thought I had stumbled across a custom function somewhere recently
that accomplished what I needed to do but can't track it down.
Can anyone help me?
Thanks,
--Kenoli
Navigation:
[Reply to this message]
|