title: How to retrieve a value from a query string that stems from a <select> form input?
body: <p>I simply need to get the selected value from a query string. Currently I just get the index of the list and not the actual value. I cant use Post as I need the value for a pagination search.</p>
  
  <p>I dont get an error but just the number of the index of the list returned. The answer must be simple and I have tried many combinations. I have tried <code>['Student']</code> in front of the query as well.</p>
  
  <p>I just couldnt see the answer in the docs and previous posts on this topic didnt work for me either. I am stuck.</p>
  
  <p>The query string has a number {url}students/myindex5?address_suburb=1 //suburb should be a string and it appears as a string in the drop down list</p>
  
  <pre><code>public function myindex5() {
  
      $this-&gt;set('filterSuburb', $this-&gt;Student-&gt;find('list', array(
          'fields' =&gt; array('Student.address_suburb')
      )));
  
      $havefilter = false;        
      $tsub = $this-&gt;request-&gt;query['address_suburb'];  
      // $tsub = array_combine($tsub, $tsub);//didnt work
      debug($tsub); //I just get the index value of the list
  
      if (!empty($tsub)) {
          // ...
  </code></pre>
  
  <p>View</p>
  
  <pre><code>echo $this-&gt;Form-&gt;create('Student', array(
      'type' =&gt; 'get',
      'url' =&gt; array('controller' =&gt; 'students', 'action' =&gt; 'myindex5')
  ));
  echo $this-&gt;Form-&gt;input('address_suburb', array(
      'options' =&gt; $filterSuburb,
      'empty' =&gt; '(choose one)')
  );
  echo $this-&gt;Form-&gt;end('Search'); 
  </code></pre>
  
  <p>For reference</p>
  
  <ul>
  <li><strong><a href="https://stackoverflow.com/questions/18909899/how-to-get-the-selected-values-from-a-drop-down-list-in-cake-php">how to get the selected values from a drop down list in cake php</a></strong></li>
  <li><strong><a href="http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html" rel="nofollow noreferrer">http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html</a></strong></li>
  </ul>