Re: Storing HTML: HTML entities being rendered in that raw form

Поиск
Список
Период
Сортировка
От linnewbie
Тема Re: Storing HTML: HTML entities being rendered in that raw form
Дата
Msg-id b2f99921-a708-4678-8faf-42374f903b70@s20g2000vbp.googlegroups.com
обсуждение исходный текст
Ответ на Storing HTML: HTML entities being rendered in that raw form  (linnewbie <linnewbie@gmail.com>)
Ответы Re: Storing HTML: HTML entities being rendered in that raw form  (Richard Huxton <dev@archonet.com>)
Re: Storing HTML: HTML entities being rendered in that raw form  (Marco Colombo <pgsql@esiway.net>)
Список pgsql-general
On Apr 9, 1:00 pm, st...@blighty.com (Steve Atkins) wrote:
> On Apr 9, 2009, at 9:27 AM, linnewbie wrote:
>
> > Hi all,
>
> > I have stored HTML in a text field that I subsequently render on the
> > web.  However when I retrieve and render this data on the web I  am
> > getting the entities being rendered in their raw form, ie, instead of
> > getting the '&' symbol when '&' is stored  I'm getting the 'raw'
> > '&'.
>
> > I would be grateful if anyone can point out how I can get around this.
>
> It's a problem in your code, not the database. You're probably
> escaping it one time to many or unescaping it one time too few.
>
> Cheers,
>    Steve
>
> --
> Sent via pgsql-general mailing list (pgsql-gene...@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

To clarify, I am not escaping the string in any way.

Say the page I am saving the database is the about us page form a
company website.
First, make a from to create the about us page in a  text area field,
then I copy the
html from my text editor and past it ino this text area from.  I then
have a cgi script which
takes the contents from the text area field and stores it in the
database.

What I have on disk would be:

................................
..............................
<p> Bonnie  & Clyde</p>

which would usually be rendered as:

Bonnie & Clype

but this is not happening, it's being rendered
as:

Bonnie & Clyde




В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Minimizing Recovery Time (wal replication)
Следующее
От: Bryan Murphy
Дата:
Сообщение: Re: Minimizing Recovery Time (wal replication)