title: CodeIgniter AJAX: POST not working, GET works fine
body: <p>Fiddling inside CodeIgniter and trying to get a grip on it all as I've never worked with AJAX before.</p>
  
  <p>For some reason, my AJAX is working perfectly when I use the GET method, but if I switch it over to the POST method, it stops working.</p>
  
  <p>My JS:</p>
  
  <pre><code>$(document).ready(function(){
  
      $('.love').click(function(event) {
  
          $.ajax({
  
              type: 'GET',
              url: base_url + '/ajax/love_forum_post',
              data: { post_id: 2, user_id: 1, ajax: 1 },
  
          });
  
          return false;
  
      });
  
  });
  </code></pre>
  
  <p>And my CONTROLLER:</p>
  
  <pre><code>function love_forum_post()
  
  {
  
      $post_id = $this-&gt;input-&gt;get('post_id');
      $user_id = $this-&gt;input-&gt;get('user_id');
      $is_ajax = $this-&gt;input-&gt;get('ajax');
  
      if ($is_ajax)
  
      {
  
          $this-&gt;load-&gt;model('forums_model');
          $this-&gt;forums_model-&gt;add_love($post_id, $user_id);
  
      }
  
      // If someone tries to access the AJAX function directly.
  
      else
  
      {
  
          redirect('', 'location');
  
      }
  
  }
  </code></pre>
  
  <p>If I switch the type to 'POST' inside my JS and then catch it on the other end with $this->input->post() it doesn't work.</p>
  
  <p>Any suggestions?</p>