+ -
当前位置:首页 → 问答吧 → fckeditor的内容存读取问题

fckeditor的内容存读取问题

时间:2009-08-21

来源:互联网

fckeditor的内容存读取问题


提交fckeditor控件的内容存到数据库中的值为:
<p>内容----fckeditorfckeditor内容内容内容内容内容内容</p>

从数据库中读取放到模版页上显示的却为:
<p>内容----fckeditorfckeditor内容内容内容内容内容内容</p>



本应该在数据库存为:
<p>内容----fckeditorfckeditor内容内容内容内容内容内容</p>
画面显示为:
内容----fckeditorfckeditor内容内容内容内容内容内容


请问高手,是不是哪里还需要设置才能在显示时,不显示html标签呢?

作者: sunsmile   发布时间: 2009-08-21

顶一下!

作者: sunsmile   发布时间: 2009-08-22

再顶一下!

作者: sunsmile   发布时间: 2009-08-24

你一定是在提交表单时做了html转义处理,检查一下

作者: izyue   发布时间: 2009-08-24

顶一下!!

作者: 丛铭   发布时间: 2009-08-24



izyue


模版页:

  1. <tr>
  2.      <td>内容</td>
  3.      <td>
  4.      <html:editor type="fckeditor" id="editor" width="80%" height="300px" name="content"  />
  5.      </td>
  6. </tr>
复制代码
action类的实现:
  1. $data=$_POST;
  2. $DocumentSend = D('DocumentSend');
  3. if($DocumentSend->create()) {
  4. $DocumentSend->sendAccountId = $this->getUid();
  5. $DocumentSend->sendTime = date("Y-m-d H:i:s");

  6. $DocumentSend->add();
  7. }
复制代码
好像也没有用到html转义了

很是纳闷啊

作者: sunsmile   发布时间: 2009-08-28

  1. $data=$_POST;
  2. $DocumentSend = D('DocumentSend');
  3. if($DocumentSend->create()) {
  4. $DocumentSend->sendAccountId = $this->getUid();
  5. $DocumentSend->sendTime = date("Y-m-d H:i:s");

  6. $DocumentSend->add();
  7. }
复制代码
调试发现在$_POSt对象里面的值就是:
&lt;p&gt;内容----fckeditorfckeditor内容内容内容内容内容内容&lt;/p&gt;
也就是传过来就是这样的,猜测是Dispatcher类里面有转义啥的
可Dispatcher类和shuguangcms里的一样啊,shuguangcms里就可以正常显示

哪位大侠有预见相同问题的没有?给指点一下!

作者: sunsmile   发布时间: 2009-08-31

http://bbs.thinkphp.cn/viewthread.php?tid=8140&extra=


貌似这个原因!

作者: sunsmile   发布时间: 2009-08-31

谢谢`sunsmile  写成 stripslashes(htmlspecialchars_decode($_POST['content']))可以

作者: spark   发布时间: 2009-09-07

做个记号

作者: fgpgy   发布时间: 2010-04-15

恩,9楼的方法能用

作者: bgh1988   发布时间: 2011-11-29