Php Iframe未从ckeditor正确存储在mysql中

Php Iframe未从ckeditor正确存储在mysql中,php,mysql,iframe,ckeditor,htmlspecialchars,Php,Mysql,Iframe,Ckeditor,Htmlspecialchars,我正在使用ckeditor将格式化后的文本发布到mysql数据库中。当我发布时,它将iframe转换为编码的html,就像使用htmlspacialchars一样,但保留html代码的其余部分 我得到的是: <p>&lt;iframe frameborder=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://php.net/manual/en/function.mysql-r

我正在使用ckeditor将格式化后的文本发布到mysql数据库中。当我发布时,它将iframe转换为编码的html,就像使用
htmlspacialchars
一样,但保留html代码的其余部分

我得到的是:

<p>&lt;iframe frameborder=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://php.net/manual/en/function.mysql-real-escape-string.php&quot;&gt;&lt;/iframe&gt;</p>

<p>&nbsp;</p>

<ul>
 <li>hi lol</li>
 <li>wow</li>
 <li>yaya</li>
</ul>
iframe frameborder=“0”scrolling=“no”src=”http://php.net/manual/en/function.mysql-real-escape-string.php“/iframe

  • 嗨,哈哈
  • 雅雅
vs我想要的:

<p><iframe frameborder="0" scrolling="no" src="http://php.net/manual/en/function.mysql-real-escape-string.php"></iframe></p>

<p>&nbsp;</p>

<ul>
 <li>hi lol</li>
 <li>wow</li>
 <li>yaya</li>
</ul>

  • 嗨,哈哈
  • 雅雅
这会使其显示为html代码,而不是在页面上呈现iframe

我知道这不是mysql的问题,因为当我直接通过phpmyadmin存储它时,它会让它在页面上显示良好,呈现iframe


tinymce中也发生了同样的事情,所以可能是服务器权限问题,我不知道。

编辑器正在防止攻击。搜索一下就找到了正确的方法。

非常感谢您!!!!我还对此做了更多的研究,发现如果您使用codeigniter,在system\core\Security.php的第427行,您可以删除本例中的“顽皮”html标记(iframe)。@MikeDemen您关于codeigniter的提示本身就是一个答案,因为它对我有用。