将带有样式属性的HTML标记从Javascript传递到PHP

将带有样式属性的HTML标记从Javascript传递到PHP,php,jquery,html,ajax,codeigniter,Php,Jquery,Html,Ajax,Codeigniter,我正在使用CKeditor和一个文件输入元素。我在Jquery Ajax中用FormData传递它。。这是我的Jquery函数 function sample(){ var cmtWRITE=CKEDITOR.instances['cmtWRITE'].getData(); var vpb_files = document.getElementById('vpb-data-file').files; var vpb_data = new FormData();

我正在使用CKeditor和一个文件输入元素。我在Jquery Ajax中用FormData传递它。。这是我的Jquery函数

function sample(){
    var cmtWRITE=CKEDITOR.instances['cmtWRITE'].getData();
    var vpb_files = document.getElementById('vpb-data-file').files;
    var vpb_data = new FormData();

    $.each(storedFiles, function(keys, values)
    {
        vpb_data.append(keys, values);
    });
    vpb_data.append('cmtWRITE', cmtWRITE);
    console.log(cmtWRITE); // here just for confirmation
    for (var pair of vpb_data.entries()) {
        console.log("### "+pair[0]+ ', ' + pair[1]); // here just for confirmation
    }
    $.ajax({
        url: base_url+'aaa/xxxx',
        type: 'POST',
        data: vpb_data,
        cache: false,
        processData: false,
        contentType: false,
        dataType : 'html',
        beforeSend: function()
        {
            //doing some process
        },
        success: function(response)
        {
            //doing response
        },
        error: 
        function(e){
            console.log('Error while request..'+JSON.stringify(e));
        }
    });
}
在php函数中通过

$txt=$this->input->post("cmtWRITE");
当我回显$txt或直接回显$this->input->post(“cmtWRITE”)时,它打印为:

<p>Okay<em> </em><span [removed]>Noted</span></p>
提前谢谢。请帮我摆脱这个

CodeIgniter预处理(消毒)输入。我猜的
$xss_clean
参数是剥离属性。试一试

$txt=$this->input->post("cmtWRITE", FALSE);

您是否检查了网络监视器,以确保通过网络发送样式?如果是这样,输入对象是否正在清理来自用户的任何html?我没有得到@juan
CKEDITOR.replace( "cmtWRITE", {
  // Define the toolbar groups as it is a more accessible solution.
  toolbarGroups: [
    {"name":"basicstyles","groups":["basicstyles"]},
    {"name":"links","groups":["links"]},
    {"name":"paragraph","groups":["list","blocks"]},
    {"name":"insert","groups":["smiley"]},
    {"name":"styles","groups":["TextColor"]},
    {"name":"colors","groups":["TextColor"]}
  ],
  // Remove the redundant buttons from toolbar groups defined above.
  removeButtons: 'Strike,Subscript,Superscript,Anchor,Specialchar,Image,Source,About,Flash,Table,SpecialChar,Iframe,HorizontalRule,PageBreak',
  height:'100px'
  //removePlugins: 'clipboard',
});
$txt=$this->input->post("cmtWRITE", FALSE);