title: How to send more than one AJAX request to one PHP file?
body: <p>I am trying to send multiple AJAX requests to one PHP file, because I am creating a big project and in the index page there is a lot of buttons which have different functionality. </p>
  
  <p>It would be very bad to make for each button a file with PHP.</p>
  
  <p>This is my AJAX code:</p>
  
  <pre><code>        $('#check').click(function(){
              var val = $(this).filter('input:checked').val();                
              $.ajax({
                  url: './process/upload.php',
                  type: 'POST',
                  data: {'check': val},
                  success: function(data){
                      alert(data);
                  }
              });
          });
  </code></pre>
  
  <p>In the PHP file I can't add <code>if(isset($_POST['check'])){}</code> It won't work but if I write it like this <code>if(isset($_POST)){}</code> </p>
  
  <p>To do it like <code>if(isset($_POST)){}</code> it will cause some errors if I add <code>if(isset($_POST)){}</code> for another button </p>
  
  <p>This is the HTML:</p>
  
  <pre><code>&lt;input type="checkbox" name="check" class="check" id="check" checked&gt;
  </code></pre>