|
Posted by Sιverin Richard on 08/25/07 20:46
You have to be very carefull concening ',", and htmlentities...
use evry times EXEACTLY the same syntax. Espacially if $someblog[0] may
be modified by the user.
Moreover, i dont like your: '<? .
You may write something like:
<script>
<?
echo "document.getElementById('somewhere').innerHTML = '".
ereg_replace( "'","\\'",$someblog[0] ) .
"';";
?>
</script>
carriage returns and dblquote(") will be OK.
for single quote(') the right syntax may be:
ereg_replace( "'","\'",$someblog[0] )
or ereg_replace( "'","\\'",$someblog[0] )
or ereg_replace( "'","\\\'",$someblog[0] )
try all of this.
good luck;
encepif@gmail.com wrote:
> Hopefully someone can give me definitive answer:
>
> What steps can I take to do this process, so no breakdowns in
> presentation occurs when I use,
>
> <script>
> document.getElementById("somewhere").innerHTML = '<?print
> $someblog[0];?>'
> </script>
>
> <div id=somewhere></div>
>
> So, someblog[0] might have weird characters, un-escaped whatevers,
> that clog of the div presentation. I am not sure what to catch or
> what converters to use. What are basic considerations & science do I
> need to apply to the string prior to presentation in the div? :-)
>
> Thank you for assistance. Have a good day.
>
Navigation:
[Reply to this message]
|