Reply to Re: <? print .. DIV> + InnerHTML question, thank you

Your name:

Reply:


Posted by Rik on 08/26/07 02:13

On Sat, 25 Aug 2007 22:46:48 +0200, Séverin Richard
<severin.richard@free.fr> wrote:

> You have to be very carefull concening ',", and htmlentities...
>
> use evry times EXEACTLY the same syntax. Espacially if $someblog[0] may
> be modified by the user.
>
> Moreover, i dont like your: '<? .
>
> You may write something like:
> <script>
> <?

Don't ever rely on short tags...


> echo "document.getElementById('somewhere').innerHTML = '".
> ereg_replace( "'","\\'",$someblog[0] ) .
> "';";
> ?>
> </script>
>
> carriage returns and dblquote(") will be OK.

When did newlines in javascript strings become OK?

>
> for single quote(') the right syntax may be:
> ereg_replace( "'","\'",$someblog[0] )
> or ereg_replace( "'","\\'",$someblog[0] )
> or ereg_replace( "'","\\\'",$someblog[0] )
>
> try all of this.

And more, or better yet, not at all, at least not these constructs.
--
Rik Wasmus

[Back to original 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

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