title: Get ID from URL and send it to PHP via Ajax
body: <p>So I have a page <code>index.php?packageID=153</code>. That page has a form which when submitted is sent to PHP via Ajax call </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function()
  {
   $(document).on('submit', '#form_name', function()
   {
  
    var data = $(this).serialize();
  
  
    $.ajax({
  
    type : 'POST',
    url  : 'phpfile.php',
    data : data,
    success :  function(data) {
                  $('.result-modal').html(data);
  
              },
              error: function (request, status, error) {
                  alert(error.responseText);
                  //or console.log(request.responseText), or status or error;
              }
    });
    return false;
   });
  
  });
  &lt;/script&gt; 
  </code></pre>
  
  <p>I want to get that ID from the URL. I usually just do <code>$_GET['PackageID']</code> (in my PHP file) to get the ID from the URL when I'm not using Ajax, but it doesn't work with ajax (from what I'm experiencing). How do I get That ID in my PHP file?</p>