title: How can I pass the selected values from the dropdown list to the url query string when button submit is clicked?
body: <p>I want the $module_id and $user_name be passed to the url.</p>
  
  <p>The code below does not pass the correct values from the dropdown list to the URL query string. Can you please show me what's missing?</p>
  
  <pre><code>    &lt;?php
      $root = $_SERVER['HTTP_HOST'];
      $fullname = $_POST['user_name'];
      $user_name = explode(" ", $fullname);
      $module_id = $_POST['e_learning_module'];
      ?&gt;                          
                          &lt;form action="&lt;?php echo home_url() . '/certificate/print-request-certificate.php?id=' . $module_id . '&amp;fname=' . $user_name[0] . '&amp;lname=' . $user_name[1]; ?&gt;" method="post" name=""&gt;
  &lt;select id="user_name" name="user_name"&gt;
  &lt;option value="default"&gt;Names&lt;/option&gt;
  &lt;?php
  $query = mysql_query('SELECT DISTINCT fname, lname FROM wl_activity_logs ORDER BY fname ASC');
  
  while($row = mysql_fetch_array($query)) {
  echo '&lt;option value="' . htmlentities($row['fname'], ENT_QUOTES) . ' ' . htmlentities($row['lname'], ENT_QUOTES) . '"&gt;' . htmlentities($row['fname'], ENT_QUOTES) . ' ' .  htmlentities($row['lname'], ENT_QUOTES) . '&lt;/option&gt;';
  }
  ?&gt;
  &lt;/select&gt;
  &lt;input type="hidden" name="user_name" id="user_name_hidden"&gt;
  
  &lt;select id='e_learning_module' name="e_learning_module"&gt;
  &lt;option value="default"&gt;E-Learning Modules&lt;/option&gt;
  &lt;?php
  global $post;
  $args = array(
  'numberposts' =&gt; -1,
  'post_type' =&gt; 'wpsc-product',
  'post_status' =&gt; 'publish',
  'wpsc_product_category' =&gt; 'e-learning-modules',
  'order' =&gt; 'ASC'
  );
  $e_learning_modules = get_posts($args);
  
  foreach( $e_learning_modules as $post ) { 
                                      setup_postdata($post);
  $id = $post-&gt;ID;
  ?&gt;
  &lt;option value="&lt;? echo $id; ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/option&gt;
  &lt;?php 
  }
  ?&gt;
  &lt;/select&gt;
  &lt;input type="hidden" name="e_learning_module" id="e_learning_module_hidden"&gt;
  
  &lt;input type="submit" value="Print" name='print' /&gt;
  &lt;/form&gt; 
  </code></pre>