php - using some characters in tinymce editor -
i've implemented tinymce in php. problem can't use quotation character in editor. when submit editor content, sql syntax error (you have error in sql syntax ...). here code:
function readeditorcontent($textareaname) { $content = ''; $allowedtags='<p><strong><em><u><h1><h2><h3><h4><h5><h6><img>'; $allowedtags.='<li><ol><ul><span><div><br><ins><del>'; // should use proper html filtering here. if( $_post[$textareaname] != '' ) { $content = strip_tags(stripslashes($_post[$textareaname]), $allowedtags); } return $content; } ... $body = readeditorcontent('articlebody');
and here sql query.
$qinsert = 'insert articles (..., body, ...)' . " values( ..., '$body', ... )";
how can force mysql treat editor content content (and avoid interpreting characters quotation , etc)?
Comments
Post a Comment