title: How to distinguish between form data and jQuery variable when sent to php file from AJAX?
body: <p>I have sent form data and a seperate varialbe to a php file using ajax. My question is how to I distinguish between the variables from the form data and from the variable in the php file? </p>
  
  <pre><code>  $(document).ready(function(){
  
      $(document).on("change", ".analysis_progress_check", function(event) {
        event.preventDefault();
        if (this.checked) {
          confirm("hello world");
  
          var form = $(this).closest('form').serialize();
          var this_analysis_number = $(this).closest("form").find("input[name='analysis_number']").val();
          var data = form + '&amp;' + this_analysis_number;
  
          $(".test").val(this_analysis_number);
  
          $.ajax({
            type: "POST",
            url: "../server/insert_analyses.php?submit_analysis",
            data: data,
            success: function(message) {
              $('#success').html(message).fadeIn('fast').delay(3000).fadeOut('slow');
  
            }
          });
        }
      });
    });
  </code></pre>
  
  <p>And the php example:</p>
  
  <pre><code>if (isset($_GET['submit_analysis'])) {
      $analysis_id = $_POST['analysis_id']; //from form
      $this_analysis_number = $_POST['this_analysis_number']; //from variable
  
  
      echo $this_analysis_number;
  }
  </code></pre>