title: collecting the MySQL combobox selection from a php page
body: <p>I posted something similar to this previously but I dont think I explained it too well So im going to include a larger code snippet to highlight my troubles.</p>
  
  <p>Ive created a drop down list selection for accessing a database and I want to have the selection sent to a php page and picked up for usage.</p>
  
  <p>The drop down list accesses the database and extracts the distinct entries as required but after selecting one and submitting it, I cant work out how to collect the variable at the other end.</p>
  
  <p>For the purpose of this example I am sending the variable to the transmitting page and having another php script collect the variable and echo the content.</p>
  
  <p>Transmitting page ---------------
      
  
  <pre><code> # parameters for connection to MySQL database
                $hostname="";
                $database="";
                $ausername="";
                $apassword="";
  
                mysql_connect ("$hostname","$ausername","$apassword");
                mysql_select_db ("$database");
  
  $query = mysql_query("SELECT DISTINCT username FROM dbusers") or die(mysql_error());
  ?&gt;
  
  
  
  
  &lt;div id="seelct_users" style="position:absolute;width:466px;height:108px;"&gt;
  &lt;form name="select_user" method="POST" action="./index.php" id="Form1"&gt;
  &lt;div id="select_a_user"     style="position:absolute;left:0px;top:20px;width:100px;height:20px;z-index:11;text-    align:left;"&gt;
  &lt;span style="color:#000000;font-family:Arial;font-size:15px;"&gt;Select User&lt;/span&gt;&lt;/div&gt;
  &lt;select name="users" multiple size="1" id="users" style="position:absolute;left:93px;top:15px;width:200px;height:75px;z-index:12;"&gt;
  
  &lt;option value=""&gt; Select a user&lt;/option&gt;
       &lt;?php
       while($row = mysql_fetch_assoc($query)){
          $username = $row["username"];
      ?&gt;
    &lt;option value= &lt;?php $username ?&gt; &gt; &lt;?php echo  $username ?&gt; &lt;/option&gt;
      &lt;?php
        }?&gt;
  &lt;/select&gt;
  &lt;input type="submit" id="Button1" name="" value="Submit" style="position:absolute;left:93px;top:100px;width:96px;height:25px;z-index:13;"&gt;
  &lt;/form&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>On the same page in a seperate script there is</p>
  
  <pre><code>&lt;?php
  $search =$_POST['username'];
  echo $search; 
  ?&gt;
  </code></pre>
  
  <p>which is to simulate a processing page receiving the variable for usage, but it cant receive anything.</p>
  
  <p>I must be either very close or totally barking up the wrong tree, but I cant seem to find the answer to what its doing, can anyone explain my mistake here please.</p>
  
  <p>Thanks</p>