欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

kindeditor+mysql上传编辑好的有文字和图片的文章,结果数据库里什么都没有

程序员文章站 2024-02-02 20:13:52
...
mysqlkindeditor





KindEditor PHP






KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name="content1"]', {
cssPath : './editor/plugins/code/prettify.css',
uploadJson : './editor/php/upload_json.php',
fileManagerJson : './editor/php/file_manager_json.php',
allowFileManager : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=example]')[0].submit();
});
}
});
prettyPrint();
});



(提交快捷键: Ctrl + Enter)


$htmlData = '';
if (!empty($_POST['content1'])) {
if (get_magic_quotes_gpc()) {
$htmlData = stripslashes($_POST['content1']);
} else {
$htmlData = $_POST['content1'];
}
}
include_once("function.php");
include_once("conn/conn.php");

echo "$htmlData";
mysql_query("insert into tb_talk ('img') values ('".$htmlData."')",$conn);
echo 成功;
?>

相关标签: mysql kindeditor