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

WBOY
發布: 2016-06-06 09:37:18
原創
822 人瀏覽過

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();
});


<code><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)</form></code>
登入後複製


$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 成功;
?>

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!