If you have problems with the addslashes/stripslashes, there could be the old magic quotes thing making it difficult.
magic_quotes_gpc is an ini-setting defaulting to on in php, and will automatically add slashes to any gpc (GET, POST, COOKIE) vars.
It's actually a nice thing, but not if you're adding extra slashes :p
So if your'e ending up with \" and \\' , this may be the prob.
I'm using a dbsafe-function to manipulate the dbtext before insert:
function dbIn($text) {
$text = strip_tags($text);
$text = str_replace(chr(10),"",$text);
$text = str_replace(chr(13), "<br>", $text);
$text = addslashes($text);
return($text);
}
This just strip all tags, but you could move the strip_tags() down to the bottom and rename it htmlspecialchars($text) if you like the code to show (but not run!).
knutm