is there a way to use
<input type='text' name='fname' value=\"$fname\">
so that it does NOT slash dangerous charicters when it outputs them?
If I understand your question you can use
echo'<input type="text" name="fname" value="$fname">';
it works ok