title: how to get data from form serialize codeigniter controller
body: <p>I try to get data from ajax pass from front page to my controller but i got only string to my controller so how can i separate it one by one.</p>
  
  <p>this is form:</p>
  
  <pre><code>&lt;form class="form-horizontal form" action="&lt;?php print base_url() ?&gt;insertCategory" method="post" enctype='multipart/form-data'&gt;
            &lt;div class="box-body"&gt;
              &lt;div class="form-group"&gt;
                &lt;label for="inputEmail3" class="col-sm-2 control-label"&gt;name&lt;/label&gt;
  
                &lt;div class="col-sm-10"&gt;
                  &lt;input type="text" name='name' required class="form-control" id="inputEmail3" placeholder="Name"&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;label for="inputEmail3" class="col-sm-2 control-label"&gt;name&lt;/label&gt;
  
                &lt;div class="col-sm-10"&gt;
                  &lt;input type="text" name='test' required class="form-control" id="inputEmail3" placeholder="Name"&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;label for="inputPassword3" class="col-sm-2 control-label"&gt;Category Detail&lt;/label&gt;
  
                &lt;div class="col-sm-10"&gt;
                  &lt;textarea id="txtEditor" &gt;&lt;/textarea&gt; 
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;label for="inputPassword3"  class="col-sm-2 control-label"&gt;Image&lt;/label&gt;
  
                &lt;div class="col-sm-10"&gt;
                  &lt;input type="file" name="img" required class="form-control" &gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;!-- /.box-body --&gt;
            &lt;div class="box-footer"&gt;
              &lt;button type="submit" class="btn btn-info pull-right submit"&gt;Submit&lt;/button&gt;
            &lt;/div&gt;
            &lt;!-- /.box-footer --&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>this my code ajax:</p>
  
  <pre><code>$(".submit").click(function (e) {
    e.preventDefault();
  var data = $('.form').serialize();
  var val  = $("#txtEditor").Editor("getText");
  var page = "&lt;?php echo $page ?&gt;";
  var url  = "&lt;?php echo base_url(); ?&gt;insertCategory"
  $.ajax({
              type: "POST",
              url: url,
              data:{ 
                  "data"  : data
             },
              success: function (data) {
                 console.log(data);
              }
          });
          return false;
  });
  </code></pre>
  
  <p>and this is my controller:</p>
  
  <pre><code>public function insertCategory()
      {   
          if($this-&gt;session-&gt;userdata('logged_in')==1){
              $data = $this-&gt;input-&gt;post('data');
              var_dump($data);
  </code></pre>
  
  <p>and this my data respond by ajax:</p>
  
  <pre><code>C:\....\AdminController.php:308:string 'name=dsfdsfs&amp;test=dfsdf' (length=23)
  </code></pre>