title: Cannot Insert php data with CKEDITOR via ajax
body: <p>I have include the CKEDITOR (html editor) in order to manipulate the text in the textarea. I tried only with php (without ajax) and the data are inserted succesfully to the database.<br> The problem is, when i use ajax, cannot retrieve the data from textarea. More specific all the data inserts in the database except the data from textarea with the CKEDITOR included. <br></p>
  
  <p>Here what i tried so far: <br><BR>
  <strong>HTML</strong>
  <br></p>
  
  <pre><code>&lt;form id='editClass' enctype="multipart/form-data"&gt;
    &lt;label for="title"&gt;&lt;div class='category_title theTitle'&gt;&lt;p&gt;Title&lt;/p&gt;&lt;/div&gt;
    &lt;textarea id='title' name='title' placeholder="Enter your title"&gt;&lt;/textarea&gt;
  &lt;/label&gt;
  &lt;label for="subject"&gt;&lt;div class='category_title theSubject'&gt;&lt;p&gt;Subject&lt;/p&gt;&lt;/div&gt;
    &lt;textarea id='subject' name='subject' placeholder="Enter your subject"&gt;&lt;/textarea&gt; &lt;!-- THE TEXTAREA THAT I HAVE INCLUDE THE CKEDITOR --&gt;
  &lt;/label&gt;
    &lt;br&gt;
  &lt;label for='articlePicture'&gt;&lt;div class='category_title thePicture'&gt;&lt;p&gt;Upload picture&lt;/p&gt;&lt;/div&gt;
    &lt;input type='file' id='articlePicture' name='articlePicture'&gt;
  &lt;/label&gt;
  &lt;label for='articleVideo'&gt;&lt;div class='category_title theVideo'&gt;&lt;p&gt;Upload video&lt;/p&gt;&lt;/div&gt;
    &lt;input type='file' id='articleVideo' name='articleVideo'&gt;
  &lt;/label&gt;
    &lt;br&gt;
    &lt;label for="category"&gt;&lt;div class='category_title theCategory'&gt;&lt;p&gt;Category&lt;/p&gt;&lt;/div&gt;
    &lt;select id='category' name='category'&gt;
      &lt;option value=''&gt;Choose category&lt;/option&gt;
      &lt;option value='literature'&gt;Literature&lt;/option&gt;
      &lt;option value='poetry'&gt;Poetry&lt;/option&gt;
      &lt;option value='music'&gt;Music&lt;/option&gt;
      &lt;option value='cinema'&gt;Cinema&lt;/option&gt;
      &lt;option value='beauty'&gt;Beauty&lt;/option&gt;
    &lt;/select&gt;
  &lt;/label&gt;
  &lt;p&gt;must read&lt;/p&gt;&lt;input type='checkbox' value='true' id='must' name='must'&gt;
    &lt;input type='hidden' id='articleDate' name='articleDate' value="&lt;?php echo date('Y-m-d H:i:s'); ?&gt;"&gt;
    &lt;input type='hidden' id='postArticle' name='postArticle' value='create'&gt;
    &lt;button type='submit' id='post_btn' name='post_btn'&gt;Post article&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
  CKEDITOR.replace('subject');
  &lt;/script&gt;
  </code></pre>
  
  <p><br>
  <strong>AJAX</strong> <br><br>
  <em>I use the <code>FormData</code> object in order to include files also.</em></p>
  
  <pre><code>$("#editClass").on('submit', function(e) {
    e.preventDefault();
    var form_data = new FormData(this);
  
    $.ajax({
      url: '../controls/handlers.php',
      type: 'POST',
      data: form_data,
      datatype: "text",
      contentType: false,
      cache: false,
      processData: false,
      beforeSend: function() {
        $("#post_btn").attr("disabled", true);
        $("#post_btn").html("Please wait...");
      },
      success: function(response) {
        alert(response);
        window.location.href = 'blog_oop_index.php';
        $("#post_btn").attr("disabled", false);
        $("#post_btn").html("Post");
      }
    });
  });
  </code></pre>
  
  <p><strong>PHP</strong> <br><br></p>
  
  <pre><code>if(input::get('postArticle') == 'create') {
  
    $validate = new validate();
    $validation = $validate-&gt;check($_POST, $items = array(
      'title' =&gt; array(
        'required' =&gt; true,
        'min' =&gt; 5,
        'max' =&gt; 300
      ),
  
      'category' =&gt; array(
        'required' =&gt; true
      )
    ));
  if(!$validate-&gt;isPassed()) {
    foreach ($validate-&gt;errors() as $error) {
      echo $error;
    }
  }
    // new version
    if($validate-&gt;isPassed()) {
      $files = new files();
      $session_username = $_SESSION['username'];
      $picture = $_FILES['articlePicture'];
      $video = $_FILES['articleVideo'];
      if(empty($picture['name'])) {
        $picture_location = null;
      }
      if(empty($video['name'])) {
        $video_location = null;
      }
      if(!empty($picture['name'])) {
        $files-&gt;checkPicture($picture);
        if(!$files-&gt;isPassed()) {
          // error picture
          foreach($files-&gt;getError() as $error) {
            echo "&lt;p&gt;$error&lt;/p&gt;";
          }
        } elseif($files-&gt;isPassed()) {
          $picture_name = $picture['name'];
          $picture_tmp = $picture['tmp_name'];
          $picture_explode = explode('.', $picture_name);
          $picture_extension = strtolower(end($picture_explode));
          $random_picture_name = $session_username.rand(0, 9999).rand(0, 9999).'.'.$picture_extension;
          $picture_location = "../media/articlesImages/".$random_picture_name;
          move_uploaded_file($picture_tmp, $picture_location);
        }
      }
      if(!empty($video['name'])) {
        $files-&gt;checkVideo($video);
        if(!$files-&gt;isPassed()) {
          // error video
          foreach($files-&gt;getError() as $error) {
            echo "&lt;p&gt;$error&lt;/p&gt;";
          }
        } elseif($files-&gt;isPassed()) {
          $video_name = $video['name'];
          $video_tmp = $video['tmp_name'];
          $video_explode = explode('.', $video_name);
          $video_extension = strtolower(end($video_explode));
          $random_video_name = $session_username.rand(0, 9999).rand(0,9999).'.'.$video_extension;
          $video_location = "../media/articlesVideosImages/".$random_video_name;
          move_uploaded_file($video_tmp, $video_location);
        }
      }
      if(input::get('must') == 'true') {
        $must = 'true';
      } else {
        $must = 'false';
      }
      //insert article
  
      $article = new articles();
      $article-&gt;create('articles', array(
        'title' =&gt; input::get('title'),
        'subject' =&gt; input::get('subject'),
        'articlePicture' =&gt; $picture_location,
        'articleDate' =&gt; input::get('articleDate'),
        'category' =&gt; input::get('category'),
        'articleVideo' =&gt; $video_location,
        'commentsCount' =&gt; 0,
        'must_read' =&gt; $must
      ));
  
    }
  }
  </code></pre>
  
  <p>Of course any of these classes that you've seen above such <code>input, articles, validate</code>, works perfect. <br>
  So, PHP works fine i think, the problem with CKEDITOR is in ajax. Any ideas? </p>