问题描述
- kindeditor+mysql上传编辑好的有文字和图片的文章,结果数据库里什么都没有
-
<!doctype html>KindEditor PHP
<br>
KindEditor.ready(function(K) {<br>
var editor1 = K.create('textarea[name="content1"]', {<br>
cssPath : './editor/plugins/code/prettify.css',<br>
uploadJson : './editor/php/upload_json.php',<br>
fileManagerJson : './editor/php/file_manager_json.php',<br>
allowFileManager : true,<br>
afterCreate : function() {<br>
var self = this;<br>
K.ctrl(document, 13, function() {<br>
self.sync();<br>
K('form[name=example]')[0].submit();<br>
});<br>
K.ctrl(self.edit.doc, 13, function() {<br>
self.sync();<br>
K('form[name=example]')[0].submit();<br>
});<br>
}<br>
});<br>
prettyPrint();<br>
});<br><form name="example" method="post" action="../03/save.php"> <textarea name="content1" style="width:700px;height:200px;visibility:hidden;"><?php echo htmlspecialchars($htmlData); ?></textarea> <br /> <input type="submit" name="button" value="提交内容" /> (提交快捷键: Ctrl + Enter)
<?php
$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 成功;
?>