Wurlitzer
02-11-2007, 04:52 PM
Hi all,
I'm having trouble getting rid of this error ("unterminated string literal" in Firefox and "unterminated string constant" in IE).
Here is the code responsible for the error:
$temp .= '<span id="'.$dir.'/" title="open" class="dir" onclick=\'browse(this.title, this.id);document.getElementById("'.$test.'/Info").innerHTML = "";\' />'.$dir.'</span>';
The error occurs when the php variable $test has single quotes in it.
I tried to use addslashes($test) but the error is still there.
Can anyone help me out with this?
Thanks.
I'm having trouble getting rid of this error ("unterminated string literal" in Firefox and "unterminated string constant" in IE).
Here is the code responsible for the error:
$temp .= '<span id="'.$dir.'/" title="open" class="dir" onclick=\'browse(this.title, this.id);document.getElementById("'.$test.'/Info").innerHTML = "";\' />'.$dir.'</span>';
The error occurs when the php variable $test has single quotes in it.
I tried to use addslashes($test) but the error is still there.
Can anyone help me out with this?
Thanks.