You are here: Re: stripslashes vs quotes « PHP Programming Language « IT news, forums, messages
Re: stripslashes vs quotes

Posted by Sergei Riaguzov on 07/24/07 10:55

On Tue, 24 Jul 2007 12:48:04 +0200, Rik wrote:

>> Hmm, I can apply stripslashes() to a string, causing it to remove
>> slashes near quotes (\") but how can I change this quotes to
>> appropriate HTML quotes like "?
> htmlspecialchars()?
Thanx that seems to be the appropriate function.

> (I can't really think of a situation where all qoutes should be swapped
> for a htmlentity, and not the <,> and &...)
Well then I will ask a lamer question, what is the best way to deal with
situation when you have a textarea in a form and some text in some other
place on the page, and everything which is written in the form is send to
the same page via POST to the same textarea which produces slashes? And
the other problem is in this other part of the page where the same text
from the texarea is placed (but with some modifications). It also
contains slashes like \".

The similar page is:

http://www.google.com/translate_t

Here is the text area and translated text is placed to the right of the
textarea.

There if I see page source I can see that every " is changed to &quot; in
textarea and in the right part of the page (after translation), so I
thought that this would be the best way?

So I should just use htmlspecialchars(), not htmlentities() on strings
from POST right?

 

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

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