title: Opening a new page after drop down selection and sending a parameter with it
body: <p>I have a drop down in my page that I am generating via php after getting the rows from a query. This works fine.</p>
  
  <pre><code>&lt;?php
  $conn = new mysqli('localhost', 'user1', 'qwER$%#RFVD', 'naming_module') 
  or die ('Cannot connect to db');
  
      $result = $conn-&gt;query("select surname from Names");
  
      echo "&lt;div id='dropdown'&gt;";
      echo "&lt;select name='id'&gt;";
      echo '&lt;option value="'.$id.'"&gt;Select a name&lt;/option&gt;';
  
      while ($row = $result-&gt;fetch_assoc()) 
      {
        unset($id, $name);
        $id = $row['id'];
        $name = $row['name']; 
        echo '&lt;option value="'.$id.'"&gt;'.$name.'&lt;/option&gt;';
      }
  
      echo "&lt;/select&gt;";
      echo "&lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p>My target is, once I select a name in the drop down, I want to move automatically to another page and send the text of the selection as a parameter, so that I am able to use it inside another query in there (getting more details about the name from a database)</p>
  
  <p>Can this be done using PHP? (I also have jQuery snippets in my code, so if that is an option, I can also utilize it)</p>
  
  <p>I have tried the below, but it does not work.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() 
       {
         $("#dropdown").change(function() 
          {
             var name =  $('#dropdown :selected').text(); 
             window.location = 'http://127.0.0.1/my-site/project.php?name='  + name;
          });
  
      });
  &lt;/script&gt;
  </code></pre>