You are here: Re: Set JavaScript variable to DB contents « PHP Programming Language « IT news, forums, messages
Re: Set JavaScript variable to DB contents

Posted by Rik on 07/04/06 20:01

FP wrote:
> Not sure if this post belogs here, but I'm hoping someone can help me
> out.
> I can get the contents of the my database comments field using PHP.
> The comments field may include single or double quotes or other
> strange characters.
> How do I compensate for these problem characters when I try to set a
> JavaScript variable? eg.
>
> <SCRIPT LANGUAGE="JavaScript">
> MyComments = " <? PHP result here?>"
> </script>

addslashes()
Or maybe htmlentities() is a better choice here.

Grtz,
--
Rik Wasmus

 

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

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