Forum Moderators: coopster
Anyone spot the gotcha here?
I have a function that draws a form. It might look vaguely like this:
[pre]
function draw_form() {
$field2show=$_POST['field'];
$output=<<<EOF
<form method="post" action="blah.php">
<input type="text" name="field" value"$field2show" />
</form>
EOF;return $output;
}[/pre]
Trouble is that when a double quote is entered in the form field and it's submitted and drawn again the text is cut off from the first quote onward.
Example: th"is -> becomes th when the form is submitted and reprinted.
I've used stripslashes() on it and it doesn't work. I've noticed it has no trouble with single quotes...
SO, where's the idiot mistake?
Many thanks....
Nick