i have the following content in my first php page.
<form name="test" id="test" method="post" action="<?=$_SERVER['PHP_SELF']?>">
<textarea name="txt" id="txt"></textarea>
<input type="hidden" name="send" value="yes" id="yes">
<input type="button" name="submit" value="submit" onClick="writeme()">
</form>
i enter multiples lines in the textarea by pressing the enter key(new line). it gets saved into the db...i retrieve the contents from the da & have them placed in a string named
$strtoPrint
Now i call a javascipt function to print this string like this...
function writeme()
{
document.write("<?=$strtoPrint?>");
}
I'm ended with the following error....
Error: unterminated string literal
Source File: http://localhost/test/test_newline.php
Line: 30, Column: 16
Source Code:
document.write("1 - one - <br>2 - two - <br>3 - three - <br>4 - four - <br>5 - one - <br>6 - six
seven
eight
can anyone please help me? thanks in advance..it's very urgent.