title: Passing data from ajax function to php file/function is showing data as NULL
body: <p>I have a page with two selects, the first to choose the car manufacturer and the second to choose the car series. The select options should change accordingly to what the manufacturer has been chosen. Say if "BMW" is chosen then a list such as "3 Series", "Z Series", etc should show. Then they should change if I changed the manufacturer to "Audi". I have tried many attempts to pass through the data with AJAX to speak to my PHP function but upon the "success:function(data)", the data is null as seen on the console log. Below is my ajax code.</p>
  
  <pre><code>$(document).ready(function(){
      $('#chooseManu').on('change',function(){
          var manu = $(this).val();
          if(manu){
              $.ajax({
                  url:'ServerScripts/showStock.php?manu='+manu,
                  data:{'manu':manu},
                  dataType: 'json',
                  success:function(data){
                      // $('#chooseSeries').html(html);
                      console.log(data);
                  }
              }); 
          }
      });
  });
  </code></pre>
  
  <p>PHP Function that is to change the series options according to manufacturer chosen</p>
  
  <pre><code>function seriesChoice() {
    require 'connection.php';
  
    if (isset($_POST["manu"]) &amp;&amp; !empty($_POST["manu"])) {
      $chosenManu = json_decode($_POST["manu"]);
      $findSeries = "SELECT DISTINCT carSeries FROM carParts WHERE carManu = ".$chosenManu;
      $series = $conn-&gt;query($findSeries);
      if ($series-&gt;num_rows &gt; 0) {
        echo '&lt;option value=""&gt;Series&lt;/option&gt;';
        while($displaySeries = $series-&gt;fetch_assoc()) {
          echo '&lt;option&gt;',$displaySeries['carManu'],'&lt;/option&gt;';
        }
      } else {
        echo '&lt;option value=""&gt;Series Not Available&lt;/option&gt;';
      }
    } else {
      echo '&lt;option value=""&gt;Select Manufacturer&lt;/option&gt;';
    }
  }  
  ?&gt;
  </code></pre>
  
  <p>And then my html where it all shows: </p>
  
  <pre><code>&lt;select id="chooseManu"&gt;
                &lt;option value="0" selected="selected"&gt;Manufacturer&lt;/option&gt;
                &lt;?php
                  manuChoice();
                ?&gt;
              &lt;/select&gt;
              &lt;select id="chooseSeries"&gt;
                  &lt;?php
                    seriesChoice();
                  ?&gt;
             &lt;/select&gt;
  </code></pre>
  
  <p>In the webdev tools (F12), on the 'Network' tab, I am able to see that it does pass 'ServerScripts/showStock.php?manu=(manu chosen)', but on the console log the data shows as null. Unless I "console.log(manu)", then obviously it logs the manufacturer chosen also.
  I have tested with many statements to see if the $_POST in the php function is not empty and isset, neither are true. So it looks like the function isn't even seeing the variable being passed through at all.</p>
  
  <p>Understanding this is one of my first actual projects, I can see that there will be a lot of things here that aren't nice to see in the coding world, so please be gentle with me! However, my major concern here at the moment is getting this variable to be seen.</p>
  
  <p>If there is anything here I have not explained well or you just need clarification with please do let me know!</p>
  
  <p>Any help is greatly appreciated! </p>