【发布时间】:2015-05-15 09:06:35
【问题描述】:
我有这组复选框
提交后..我想在另一个页面中回显所选复选框(pay.php)
例如:如果我在 pay.php 页面中选择了 park andwash .. 我想回显 park andwash 但我只得到了wash(最后一个选择的复选框)那么如何打印所有选择的复选框??
<form name="input" action="pay.php" method="post">
Services:
<br/>
<input type="checkbox" name="service" value="park" checked>Park Only <br/>
<input type="checkbox" name="service" value="wash">Wash <br/>
<input type="checkbox" name="service" value="Check tires">Check Tires <br/>
<input type="checkbox" name="service" value="Fill oil">Fill Oil <br/>
<input type="checkbox" name="service" value="Check brakes">Check Brakes <br/>
<input type="submit" value="Go to Paying" />
</form>
IN PAY.php:
<?php
//$servicetext=$_POST["service"];
// echo $servicetext;
////THE ARRAY PART////
echo "<table border='0'>
<tr>
<th> //PRINT THE ARRAY HERE </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<tr/>";
?>
【问题讨论】:
-
PHP Multiple Checkbox Array 的可能重复项