Entry
Why is a single quote and everything after it being truncated when loaded into a form text box? The other escaped characters are showing up.
Apr 22nd, 2001 18:50
Onno Benschop, Bryan Lawson,
Because the single quote is ending the value declaration from your
input box.
Text: This isn't cricket
HTML: <input type=text name=bob value='This isn't cricket>
Note that the value declaration ends with the ' between n and t.
You can overcome this by using double quotes for your value declaration
and using the htmlentities function to encode the variable:
echo '<input type=text name=bob value="'.htmlentities($bob).'">' ;