Javascript 使用tinymce编辑器时,我的数据不会发布到数据库中
我真的需要帮助,因为这是我第一次在网站上使用所见即所得编辑器。 这是文本区域的代码:Javascript 使用tinymce编辑器时,我的数据不会发布到数据库中,javascript,php,html,mysql,wysiwyg,Javascript,Php,Html,Mysql,Wysiwyg,我真的需要帮助,因为这是我第一次在网站上使用所见即所得编辑器。 这是文本区域的代码:和tinymce集成的代码: <script> tinymce.init({ selector: '#news', browser_spellcheck: true, branding: false, height: 400, menu: {
和tinymce集成的代码:
<script>
tinymce.init({
selector: '#news',
browser_spellcheck: true,
branding: false,
height: 400,
menu: {
file: {title: 'File', items: 'newdocument'},
edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall'},
insert: {title: 'Insert', items: 'link media | template hr'},
view: {title: 'View', items: 'visualaid'},
format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'},
tools: {title: 'Tools', items: 'spellchecker code'}
},
menubar: 'file edit insert view format table tools help',
toolbar: ['undo', 'redo','searchreplace', 'preview'],
plugins: [ 'code', 'lists', 'autolink', 'preview', 'searchreplace', 'wordcount'],
encoding: 'xml'
});
</script>
我还允许$content(textarea的值)通过一些函数,如striptags和htmlentities,我在提交后打印出$content的值,并以xml显示,我不认为这是一个问题。我唯一的问题是,在第一次提交后,它不会在数据库中显示连续的数据。谢谢我想我会自己回答这个问题,我犯了一个非常愚蠢的错误,我发现是撇号造成了这个错误。我用bindParam解决了这个问题。您也可以使用addslashes()函数来实现这一点。我想我会自己回答这个问题,我犯了一个非常愚蠢的错误,我发现撇号导致了错误。我用bindParam解决了这个问题。您也可以使用addslashes()函数来实现这一点
$ins->insert('headline', array('id'=>'','post_id'=>$pi_id,'post_cat'=>$cat,'post_title'=>$title,'post_cont'=>$content));