我使用的是 ckeditor 基础版 4.3。当我在 MySQL 中存储数据时,格式化的数据不会被存储。例如,当我使用项目符号或编号时,它不会在我格式化时被存储。如何解决这个问题?
这是我用来集成和存储的代码。
<script src="ckeditor1/ckeditor/ckeditor.js"></script>
<textarea name="editor1" id="editor1" rows="10" cols="10"></textarea>
<script>
CKEDITOR.replace( 'editor1' );
</script>
<?php
$abt_description =$_POST['editor1'];
$insert_news = mysql_query("insert into table (colum) values ('$abt_description');
?>
最佳答案
正如评论者所说,stripslashes()
解决了这个问题。在插入之前添加:
$abt_description = stripslashes($abt_description);
注意:我建议在您的输入中使用 mysql_real_escape_string()
。
关于javascript - 当我格式化到 mysql 中时,Ckeditor 不存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21881067/