title: Upon selecting from an html drop down, redirect page and pass the selection value through url?
body: <p>Here is what the form looks like as of now...</p>
  
  <pre><code>&lt;select onchange="viewForm()"&gt;
  &lt;?php
      $db = mysqli_connect('xxxxxx.com', 'xxxx', 'xxxx', 'xxxxx');
      $sql = "SELECT title, fid FROM total";
      $result = $db-&gt;query($sql);
      while ($row = $result-&gt;fetch_assoc()){
          $sid = $row['fid'];
          $stitle = $row['title'];
          echo '&lt;option value="'.$sid.'" &gt;'.$stitle.'&lt;/option&gt;';
      }
  ?&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And then here is the javascript function....</p>
  
  <pre><code>function viewForm(){
      window.location.replace("http://website.com/main.php?sid=IDwouldGoHere");
  }
  </code></pre>
  
  <p>What i am trying to do is when one of the drop down options is selected, redirect to a new page while passing the 'sid' value through GET. Right now the redirect is working, but i can't find a way to pass the sid value to the javascript function.</p>