title: PHP POST array is empty after data is posted through ajax
body: <p>I've a simple select which on change posts data through ajax. On the same page I want to get the data from POST array but the post array is empty. This is the code. </p>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>$('.product-selectbox').change(function() {
      var select_id = $(this).attr("id");
      var presentkort_type = $(this).val();
      presentkort_type = presentkort_type;
      alert(presentkort_type);
      //alert("id is "+id);
      var request =  $.ajax({
          url : "cashregister",
          type : "POST",
          data : {
              prod_id : select_id, presenkort : presentkort_type
          },
          dataType : "html"
      });
      request.done(function(msg) {
          $('#data').html(select_id);
          console.log(select_id);
          console.log(presentkort_type);
          location.reload(true);
      });
      request.fail(function(msg) {});
  });
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>if (isset($_POST['prod_id'])) {
      $product_id = (int)$_POST['prod_id'];
      print "product id is ".$product_id;
  } else {
      print "no data";
      $product_id = (int)$_POST['prod_id'];
  }
  </code></pre>