0

This is my form:

    <form action="script.php" method="post">
    <SELECT id="avail" name="avail[]" size=5>                                       
           <option value="Avocado">Avocado</option>                                     
           <option value="Bacon">Bacon</option>
           <option value="Black pepper">Black pepper</option>
    </select>
    </form>

How can I get the values available in the select menu from script.php ???

$_POST["avail"] doesn't work.

Thanks

Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95
michele
  • 26,348
  • 30
  • 111
  • 168

1 Answers1

0

$_POST['avail'][0] will contain the select's value the way you have it. You are using an array by specifying name='avail[]' in the select. You don't need to do this unless you have multiple selects with the same name.

Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95