Multiple selects are not being submitted in the form using post?
<p>I am trying to create a form where I need to allow user to select different values (from select tag) against some labels. 
I have two different array in php.  </p>

<ol>
<li>the standard array that contains the labels for select.   </li>
<li>a set of values to be selected against the labels.  </li>
</ol>

<p>My problem is when I press the submit button, the form is submitted but <code>$_POST</code> does not show any value selected by the select tag. I want to get the selected values against the labels. </p>

<p>here is my code: </p>

<pre><code>&lt;?php 
    $data = array ('name', 'phone', 'address');
    $values = array('a','2344','xyz');
?&gt;

&lt;html&gt;
&lt;head&gt;&lt;/head&gt;
&lt;body&gt;

    &lt;form action="&lt;?php $_SERVER["PHP_SELF"]  ?&gt;" method="post"&gt;
    &lt;?php for($i = 0; $i &lt; count($data); $i++){ ?&gt;
          &lt;label for='&lt;?php $data[$i]?&gt;'&gt; &lt;?php echo $data[$i]?&gt;&lt;/label&gt;  
          &lt;select name='&lt;?php $data[$i]?&gt;' id = '&lt;?php $data[$i]?&gt;'&gt; 
         &lt;?php foreach($values as $val){ ?&gt;        
             &lt;option value='&lt;?php $val ?&gt;'&gt;  &lt;?php echo $val ?&gt; &lt;/option&gt;
         &lt;?php } ?&gt;    

        &lt;/select&gt;   
   &lt;?php  } ?&gt;

&lt;button type="submit" name="submit" value="submit"&gt;Submit&lt;/button&gt;    
&lt;br&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

&lt;?php
if(isset($_POST['submit'])){
echo$_POST['name'];
}
?&gt;
</code></pre>

<p>When I press the submit button the error I get is "Notice: Undefined index: name". I have extensively searched in the questions already posted about multiple select statements but none of the answers matched my criteria. Thanks for the help.  </p>