seco Posted February 12, 2008 Share Posted February 12, 2008 Hi i write $fieldvalue= ' <script type="text/javascript"> ' . 'var txt="' . $fieldvalue . '" ; unescape(txt.replace(/\+/g, " "));' . '</script>'; i find that $fieldvalue equales to the hole javascript block just i want to decode $fieldvalue using unescape function so how to do it? thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/90762-how-to-process-php-variable-in-js-code-and-hand-it-back/ Share on other sites More sharing options...
haku Posted February 12, 2008 Share Posted February 12, 2008 You cant use javascript inside a php function. PHP is processed server side, so it doesn't have any access to javascript which is client side. Quote Link to comment https://forums.phpfreaks.com/topic/90762-how-to-process-php-variable-in-js-code-and-hand-it-back/#findComment-465380 Share on other sites More sharing options...
seco Posted February 13, 2008 Author Share Posted February 13, 2008 so any way to process my php variable to decode it and assign it again if its impossible is there any php server side can do like unescape(txt.replace(/\+/g, " "));' . because i try urldecode and rawurldecode and dont do nothing for me just return them back as if they were !! no changes at all !!! Quote Link to comment https://forums.phpfreaks.com/topic/90762-how-to-process-php-variable-in-js-code-and-hand-it-back/#findComment-465662 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.