Forum Moderators: open
Here is the function I use to display strings that may have quotes in form fields:
function form($str){
return htmlspecialchars [php.net](str_replace("''", "'", $str), ENT_QUOTES);
}
You may, or may not, need the str_replace() part. In my case, it fixes the automatic escaping of single quotes that happens on this server(magic_quotes).
Ther usage would be:
echo '<input type="text" value="' . form($text1value) . '" name="text1" />';
Thanks again for your help.