Forum Moderators: coopster
I then try to pass this to some javascript but because of the quotes, something is getting messed up (I get an unterminated string constant error). Taking out the quotes from the document.write section doesn't work...
ANy ideas on how to fix this?
?>
<script language = 'javascript' type='text/javascript'>
NewWin = window.open('', 'newwin', 'height=250, width=250,toolbar=no,scrollbars='+scroll+',menubar=no');
NewWin.document.write("<TITLE>Title Goes Here</TITLE>");
NewWin.document.write("<BODY>");
NewWin.document.write("<?php echo $message;?>");
NewWin.document.write("</BODY>");
NewWin.document.write("</HTML>");
</script>
<?
Thanks.
<?php echo addslashes($message); ?>
;)
However if I put the variable text in without line returns:
$message = "<html><img src =''>";
it prints fine.
Problem is that the formatting is then very difficult to read...
<?php echo preg_replace("/\r?\n/", "\\n", addslashes($message)); ?>