Reply to Re: Storing a javascript variable in a php string

Your name:

Reply:


Posted by Kimmo Laine on 07/07/06 07:26

"Markus Schuster" <schumax@sbox.tugraz.at> wrote in message
news:44ae09cd$0$12384$3b214f66@aconews.univie.ac.at...
> Hi,
>
> I have the following javascript function:
>
> <script type="text/javascript">
>
> function HTMLEncode( text )
> {
> text = text.replace(/&/g, "&amp;") ;
> text = text.replace(/"/g, "&quot;") ;
> text = text.replace(/</g, "&lt;") ;
> text = text.replace(/>/g, "&gt;") ;
> text = text.replace(/'/g, "&#39;") ;
>
> return text ;
> }
>
> </script>
>
> Now I want to store the content of 'text' in a php string.
> Is that possible?


Yes, insert the text in an input element that is inside a form and submit
the form to the recieving php page.

By the way, a similar conversion function is available also in php, called
htmlentities.

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

[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

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