PDA

View Full Version : \ in front of "


don
12-09-2002, 04:36 PM
I get the magic_quotes thing. But for some reason it only works for the single quote. When a double quote is entered it puts in the \ but then truncates everything after it.

Any ideas?

don
12-09-2002, 05:14 PM
Ok, I'm wrong. Really it's an issue with mixing HTML and PHP.

What is happening is the following:

<?php

$foo = "Help\"Me";
echo $foo;

?>

<br>
<input value="<?php echo $foo ?>">

don
12-09-2002, 05:19 PM
For what it's worth I fixed it using htmlspecialchars()

<?php

$foo = htmlspecialchars("Help\"Me");
echo $foo;

?>

<br>
<input value="<?php echo $foo ?>">