title: Unable to recive values in destination file Typeahead.js
body: <p>I have written some script to auto fill the search input (search data from database), Along with query I am sending some dynamic variable in remote url for advanced search .</p>
  
  <p>But I am not receiving any data in destination file , if sent only query in 'remote' its working fine but along with  dynamic variable in remote url its not working ! please check my code and guide me where I am wrong </p>
  
  <pre><code>&lt;script src="typeahead.min.js"&gt;&lt;/script&gt;
     &lt;script&gt;
  $(document).ready(function(){
  $('input.typeahead').typeahead({
      name: 'typeahead',
      //remote:'subtasksearch.php?key=%QUERY',
      //remote:'subtasksearch.php?key=%QUERY&amp;&amp;mani=123',
      remote: {
      url: 'subtasksearch.php?key=%QUERY&amp;&amp;mani=',
      replace: function () {
          var q = 'subtasksearch.php?key=%QUERY&amp;&amp;mani=';
          if ($('#country').val()) {
              q += encodeURIComponent($('#country').val());
          }
          return q;
        }
      },
      limit : 10
  });
   });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>And my subtasksearch.php is</strong> </p>
  
  <pre><code>&lt;?php
  $key=$_GET['key'];
  $mani=$_GET['mani'];
  $array = array();
  $con=mysqli_connect("localhost","","","");
  
  if (mysqli_connect_errno())
   {
     echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
  
  
  $query=mysqli_query($con, "select * from sub_task where name LIKE '%{$key}%'");
  while($row=mysqli_fetch_assoc($query))
  {
    $array[] = $row['name'];
    //$array[] = $mani;
  }
  echo json_encode($array);
  </code></pre>
  
  <p><strong>And my search input is</strong> </p>
  
  <pre><code> &lt;input type="text" name="typeahead" class="typeahead tt-query" autocomplete="off" spellcheck="false" placeholder="Type your Task" required=""&gt;
  </code></pre>
  
  <p>If you use simple remote to send query its working fine </p>
  
  <pre><code>remote:'subtasksearch.php?key=%QUERY',
  //or
  remote:'subtasksearch.php?key=%QUERY&amp;&amp;mani=123',
  </code></pre>
  
  <p>With dynamic variable in remote url is not working , I have observed few things in console the data is passing in URL and returning empty array I guess please check the bellow image</p>
  
  <p><a href="https://i.stack.imgur.com/Pa3S3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pa3S3.png" alt="console image"></a> </p>
  
  <p>Please guide Me where I am wrong! Is I am sending values in wrong way ?</p>