Posted by php_mysql_beginer911 on 12/09/07 02:51
Hi everyone ..
i am trying to use a string which was saved by php form and contain
single quote ' or double quote
" .. when i using that string in my js script function like
function
onclick='js_test("<?=$string;?>")'
if $string contains double quote it will simply break the function ..
and same goes for single quote if i
surround $string with single quote i tried using escape and unescape
but that means .. every place i am using php ddata which might contain
single or double quote i have to use those javascript
function . as i am very new to programming if somebody could advise
what is the best way to deal
with string when we use js script and php
hope you can understand my english and hope somebody will reply soon
thanks
[Back to original message]
|