Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Ckeditor通过ajax表单提交方法发布html内容_Php_Ajax_Forms_Ckeditor - Fatal编程技术网

Php Ckeditor通过ajax表单提交方法发布html内容

Php Ckeditor通过ajax表单提交方法发布html内容,php,ajax,forms,ckeditor,Php,Ajax,Forms,Ckeditor,我有一个带有ckeditor的简单表单textarea,它是 <textarea class="form-control ckeditor" name="ex" id="ex">My Description</textarea> and this the content getting by alert. <p>My description</p> 我的描述 这是通过警报获取的内容。 我的描述 现在我通过malsupajax表单提交方法将表单

我有一个带有ckeditor的简单表单textarea,它是

<textarea class="form-control ckeditor" name="ex" id="ex">My Description</textarea>
 and this the content getting by alert.
<p>My description</p>
我的描述
这是通过警报获取的内容。
我的描述

现在我通过malsupajax表单提交方法将表单提交到后端文件。但是我在
$\u POST['ex'中没有得到这个值

var\u dump($\u POST['ex'])
提供空字符串。 我还尝试了
htmlentities()
,但它不起作用。如何将此说明插入到
mysql
数据库中。因为它不是字符串。我需要这个后端文件的描述


有人能给我举一个这个流程的例子吗。

CKEditor创建了一个iframe来替换textarea,而实际的textarea没有被使用。您可能需要做的是在提交之前更新textarea

for(var instanceName in CKEDITOR.instances)
{
    CKEDITOR.instances[instanceName].updateElement();
}
然后在服务器端,只需执行您的操作

echo $_POST['ex'];

textarea内容是空的,内容不在里面吗?@MaK是一个生成html内容的ckeditor。它应该是php变量。谢谢,请告诉我这里的instanceName是什么。它只是一个变量,由循环为CkeditorTanks中的每个实例设置,以供回复。