HTML多选表单不起作用

时间:2017-03-25 15:35:27

标签: php

我是PHP新手。 请检查以下代码;多选不起作用。不知道为什么。提前谢谢。

<form action="test.php">
    <select  name="fin[]" multiple ="multiple" class = "multiple_select" id = "selected_options_fin" style="height: 200px">
        <option value="week_period">Week Period</option>
        <option value="comments_approved">Comments Approved</option>
        <option value="comment_replies">Comment Replies</option>
        <option value="avarage_response_time">Average Response Time</option>
        <option value="avarage_response_time_in_minutes">Average Response Time in Minutes</option>
        <option value="commenter_visits">Commenter Visits</option>
        <option value="percentage_of_new_visits">% New Visits</option>
        <option value="number_of_goal_completions"># of Goal Completions</option>
        <option value="conversions_rate">Conversions Rate</option>
    </select>
    <input type="submit" name = "submit1" Value = "SUBMIT" id="submit_fin">                
</form>          


<?php

if (isset($_POST['fin'])) {
    $fin_array = $_POST['fin'];
    $loop_count = 0;
    foreach ($fin_array as $key => $value) {
        $loop_count++;
        echo 'Column $loop_count || Array Key = $key || Value = $value<br />';
    }
    exit();
}

1 个答案:

答案 0 :(得分:0)

抱歉打扰 第一行需要

form action =“test.php”method =“post”