You are here: Tags, quotes, textarea and mysql « All PHP « IT news, forums, messages
Tags, quotes, textarea and mysql

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация