0
這裏我想用post方法捕獲數組值。任何人都可以幫助我,我到底錯在哪裏?多選擇捕獲,發佈方法
<html>
<body>
<form action="test1.php" method="post">
<ul>
<li class="fltlft newDesgnCal" style="margin-left:0px;margin-top:0px">
<select id="filterCal" multiple="multiple" name="it_budget[]">
<option value="0-50" <?php if((isset($_POST["it_budget"][0])) && ($_POST["it_budget"][0] == '0-50')){?> selected <?php } ?>>€0-€50Mn</option>
<option value="50-100" <?php if((isset($_POST["it_budget"][0]) == '50-100' || isset($_POST["it_budget"][1]) == '50-100')){?> selected <?php } ?>>€50-€100Mn</option>
<option value="100-1150" <?php if((isset($_POST["it_budget"][0]) == '100-1150' || isset($_POST["it_budget"][1]) == '100-1150' || isset($_POST["it_budget"][2]) == '100-1150')){?> selected <?php } ?>>>€100Mn</option>
</select>
</li>
</ul>
</td>
<td>
<ul>
<li class="fltlft newDesgnCal" style="margin-left:0px;margin-top:0px">
<select id="filterCal" multiple="multiple" name="Contract_Size[]">
<option value="0-25" <?php if(isset($_POST["Contract_Size"][0]) && ($_POST["Contract_Size"][0] == '0-25')){?> selected <?php } ?>>€0-€25Mn</option>
<option value="25-50" <?php if(isset($_POST["Contract_Size"][0]) || isset($_POST["Contract_Size"][1]) && ($_POST["Contract_Size"][0] == '25-50' || $_POST["Contract_Size"][1] == '25-50')){?> selected <?php } ?>>€25-€50Mn</option>
<option value="50-100" <?php if(isset($_POST["Contract_Size"][0]) || isset($_POST["Contract_Size"][1]) || isset($_POST["Contract_Size"][2]) && ($_POST["Contract_Size"][0] == '50-100' || $_POST["Contract_Size"][1] == '50-100' || $_POST["Contract_Size"][2] == '50-100') ){?> selected <?php } ?>>€50-€100Mn</option>
<option value="100-300" <?php if(isset($_POST["Contract_Size"][0]) || isset($_POST["Contract_Size"][1]) || isset($_POST["Contract_Size"][2]) || isset($_POST["Contract_Size"][3]) && ($_POST["Contract_Size"][0] == '100-300' || $_POST["Contract_Size"][1] == '100-300' || $_POST["Contract_Size"][2] == '100-300' || $_POST["Contract_Size"][3] == '100-300') ){?> selected <?php } ?>>€100-€300Mn</option>
<option value="300-10000" <?php if(isset($_POST["Contract_Size"][0]) || isset($_POST["Contract_Size"][1]) || isset($_POST["Contract_Size"][2]) || isset($_POST["Contract_Size"][3]) || isset($_POST["Contract_Size"][4]) && ($_POST["Contract_Size"][0] == '300-10000' || $_POST["Contract_Size"][1] == '300-10000' || $_POST["Contract_Size"][2] == '300-10000' || $_POST["Contract_Size"][3] == '300-10000' || $_POST["Contract_Size"][3] == '300-10000') ){?> selected <?php } ?>>>€300Mn</option>
</select>
</li>
</ul>
<input type="submit"/>
</form>
</body>
</html>
</ul>
它說: 「警告:\ XAMPP \ htdocs中\ oppInsights \ test1.php第7行>€0-€50MN:在提供的foreach()無效參數」 – 3bu1