title: How to send id of a retrieved value in drop down list from database to a php file?
body: <p>peace be with you all, I am retrieving some values from database and displaying in a drop down list using ajax and php.After selecting a field from drop down list(i.e. one of $row['course_codes']) I want to send the primary key contained in $courseId to another file for further processing after clicling the submit button. I am getting the values in drop down as expected but i can not pass the id to another file. Here is my code used to retrieved data in drop down list.</p>
  
  <pre><code>&lt;?php
      $qd = $_GET['q'];
  $q = mysql_real_escape_string($qd);
  $branch = $_SESSION['session_branch'];
  $_SESSION['sem'] = $q;
  $query = "select *FROM course_details WHERE branch='" . $branch . "' AND sem = '" . $q . "'";               
      $run = mysql_query($query) or die($query."&lt;br/&gt;&lt;br/&gt;".mysql_error()); 
  $num = mysql_numrows($run); 
  ?&gt;
  
  &lt;select class="action" name='id'&gt;
  &lt;option name="usn" value="" class="displayUsn"&gt;-- Select Course --&lt;/option&gt;
  &lt;?php
              while($row = mysql_fetch_assoc($run)){
                  $courseId = $row['course_id'];
                  echo "&lt;option class='displayRec' value = 'addToTemp.php?id=$courseId'" . "&gt;" . $row['course_codes'] . "&lt;/option&gt;"; 
              }   
              echo "&lt;/select&gt;";
              if($num &gt; 0){
                  echo " ";
                  echo "&lt;input type='button' onClick=\"window.location.href='addToTemp.php'\" value='Add' id='id'&gt;";          
              }else{
                  echo "No courses available";
              }
              mysql_close($bd);
  ?&gt;
  </code></pre>
  
  <p>in addToTemp.php i am trying to get the id as follows:</p>
  
  <pre><code>if(isset($_GET['id'])){
  $getId = $_GET['id'];
  }
  </code></pre>
  
  <p>but id does not contained any value. please help.</p>