|
Posted by Markus Schuster on 07/07/06 08:32
Markus Schuster schrieb:
> Kimmo Laine schrieb:
>> "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, "&") ;
>>> text = text.replace(/"/g, """) ;
>>> text = text.replace(/</g, "<") ;
>>> text = text.replace(/>/g, ">") ;
>>> text = text.replace(/'/g, "'") ;
>>>
>>> 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.
>
> You mean it like that?
>
> <form action="bla.php" method="post">
> <input type="hidden" name="text" value=text>
> <input type="submit" name="show" value="show">
> </form>
>
>
> Is that part ok?
>
> value=text
>
> Or how can I do it correctly?
>
> Thanks, Max
>
>
>> By the way, a similar conversion function is available also in php,
>> called htmlentities.
>>
Thanks I have it, it works fine.
Max
Navigation:
[Reply to this message]
|