如何将正确的html选择值传递给$ _POST php

时间:2010-12-13 01:36:08

标签: php html select post

我试过像这样的HTML:

<form method="post">
   <select id="select" size="2 ">
        <option value="3">test</option>
        <option value="4">test2</option>                     
   </select>
   <button type="submit" value="execute">
</form>

如何在post数组中获得3或4的值

$_POST['select']

1 个答案:

答案 0 :(得分:24)

添加名称标签......

<select id="select" name="select" size="2 ">