I have a field in the form that contains HTML, so I use htmlspecialchars
before displaying it to the user, so it actually shows up like HTML (with tags), so something like this
//in my php script, right after I get the values from the database
$someVar = htmlspecialchars($someVar);
//inside html (I use Smarty template)
<input id="someVar" name="someVar" type="text" size="50" value="{$someVar}"></input>
Now the problem happens when the user submits the form, somehow tags are lost on the page submit and I simply get the text (interpreted HTML) written to the database.
How do I successfully allow the user to edit fields that contain HTML tags?