<link rel="stylesheet" href="../editor/themes/default/default.css" />
<script charset="utf-8" src="../editor/kindeditor.js"></script>
<script charset="utf-8" src="../editor/lang/zh_CN.js"></script>
<script>
KindEditor.ready(function(K) {
window.editor = K.create('#editor_id',{
resizeType :'0'
});
});
</script>
<script>
KindEditor.ready(function(K) {
var uploadbutton = K.uploadbutton({
button : K('#uploadButton')[0],
fieldName : 'imgFile',
url : '../editor/php/upload_json.php?dir=image',
afterUpload : function(data) {
if (data.error === 0) {
var url = K.formatUrl(data.url, 'absolute');
K('#imgurl').val(url);
} else {
alert(data.message);
}
},
afterError : function(str) {
alert('自定义错误信息: ' + str);
}
});
uploadbutton.fileBox.change(function(e) {
uploadbutton.submit();
});
});
</script>
<div id="user_main">
<div id="left">
<?php require 'left.php'; ?>
</div>
<div id="right">
<div id="right_top"><div style="padding-top:5px;padding-left:10px;">后台管理 - 发布新闻</div></div>
<div id="right_main">
<?php
isset($_SERVER['QUERY_STRING'])?$post=$_SERVER['QUERY_STRING']:null;
require '../config.php';
if($post=="post")
{
$title = $_POST['title'];
$img = $_POST['img'];
$laiyuan = $_POST['laiyuan'];
$text = $_POST['editor_id'];
$text = stripcslashes($text);
ini_set("datetime.zone","PRC");
$datetime = date("Y-m-d H:i:s");
$htmltext = strip_tags($text);
$jianjie = mb_substr($htmltext,0,100,'GB2312');
$inadsql = "insert into xwmi_news (title,images,text,datetime,laiyuan,jianjie) values ('$title','$img','$text','$datetime','$laiyuan','$jianjie')";
$inadok = mysql_query($inadsql,$config);
if($inadok)
{
echo "<script>window.onload=function inadokjs(){alert('成功发布');location.href='inad.php'}</script>";
}
else
{
echo "<script>window.onload=function inadokjs(){alert('数据库或程序出错!');}</script>";
}
}
?>
<table width="780" cellpadding="8" cellspacing="1" bgcolor="silver">
<form method="post" action="?post" >
<tr bgcolor="#ffffff">
<td width="100" align="right">新闻标题:</td>
<td align="left"><input name="title" style="width: 300px;height:20px;background-color: #F0F8FF;border: #7F9DB9 solid 1px;line-height: 20px;" /></td>
</tr>
<tr bgcolor="#ffffff">
<td width="100" align="right">新闻来源:</td>
<td align="left"><input name="laiyuan" style="width: 300px;height:20px;background-color: #F0F8FF;border: #7F9DB9 solid 1px;line-height: 20px;" /></td>
</tr>
<tr bgcolor="#ffffff">
<td align="right">缩略图:</td>
<td align="left"><input class="ke-input-text" type="text" id="imgurl" name="img" readonly="readonly" style="width: 300px;height:20px;background-color: #F0F8FF;border: #7F9DB9 solid 1px;line-height: 20px;" /> <input type="button" id="uploadButton" value="点击上传图片" /></td>
</tr>
<tr bgcolor="#ffffff">
<td align="right">新闻内容:</td>
<td align="left"><textarea id="editor_id" name="editor_id" style="width:680px;height:300px;"></textarea></td>
</tr>
<tr bgcolor="#ffffff">
<td align="left" colspan="2" style="padding-left: 120px;" >
<button type="submit" style="width: 100px;height:28px;background-color: #FFFFFF;border:#004D00 solid 1px;font-size:14px;color: #004D00;" >发布新闻</button>
</td>
</tr>
</form>
</table>
</div>
</div>
</div>
那我这个代码里为什么就textarea的内容存不进数据库?其他的都可以 |