我有一个相当基本的问题,但我无法理解它。
我有一个多年来一直运行良好的 PHP 表单,突然之间,php 表单值没有与 post 数据一起传递。为了解决问题,我开始从表单中删除一些行,我到了某个点,for 又开始工作了。所以我加了一条线,它就停止了?我根本无法解释这一点。我检查了 post_max_size 设置和它的 120m 所以不可能是问题。甚至提交按钮的 POST 值也没有被传递。print_r() 不显示任何数据。
我的完整表格(曾经有效)是:
<form name="form1" id="form1" action="bsassigncosts.php" method="post">
<table id="hor-minimalist-a">
<tr>
<th></th>
<th>Date & Time</th>
<th>Parked</th>
<th><font color=red>Load Number</font></th>
<th><font color=red>Trailer</font></th>
<th><font color=red>Weight</font> kg's</th>
<th><font color=red>Source</font></th>
<th><font color=red>Destination</font></th>
<th><font color=red>Cycle Type</font></th>
<th><font color=red>Rate to be applied</font></th>
<th>LOC Status / Comments</th>
</tr>
<? while($row = $loads->fetch(PDO::FETCH_ASSOC)) { ?>
<tr>
<td><input type="checkbox" name="checkbox[]" id="checkbox[]" value="<? echo $row['loadnumber']; ?>"></td>
<td><? echo $row['sarrive']; ?></td>
<td><input type="radio" <? if($row['parkinglot']==="yes"){echo "checked='checked'";} ?> disabled > </td>
<td><input type="text" name="correctedloadnumber<? echo $row['loadnumber']; ?>" id="correctedloadnumber<? echo $row['loadnumber']; ?>" value="<? echo $row['loadnumber']; ?>" class="inputsmall"></td>
<td>
<SELECT name="correctedtrailer<? echo $row['loadnumber']; ?>" id="correctedtrailer<? echo $row['loadnumber']; ?>" class="selectnarrow">
<OPTION value="<? echo $row['trailer']; ?>" selected ><? echo $row['trailer']; ?></option>
<option>
<?=$optionstrailer?>
</option>
</SELECT>
</td>
<td><input type="text" name="correctedweight<? echo $row['loadnumber']; ?>" id="correctedweight<? echo $row['loadnumber']; ?>" value="<? echo $row['weight']; ?>" class="inputsmall"></td>
<td>
<SELECT name="correctedsource<? echo $row['loadnumber']; ?>" id="correctedsource<? echo $row['loadnumber']; ?>" class="selectnarrow">
<OPTION value="<? echo $row['source']; ?>" selected ><? echo $row['source']; ?></option>
<option>
<?=$optionssource?>
</option>
</SELECT>
</td>
<td>
<SELECT name="correcteddestination<? echo $row['loadnumber']; ?>" id="correcteddestination<? echo $row['loadnumber']; ?>" class="selectnarrow">
<OPTION value="<? echo $row['destination']; ?>" selected ><? echo $row['destination']; ?></option>
<option>
<?=$optionsdestination?>
</option>
</SELECT>
</td>
<td>
<SELECT name="correctedcycletype<? echo $row['loadnumber']; ?>" id="correctedcycletype<? echo $row['loadnumber']; ?>" class="selectnarrow">
<OPTION value="<? echo $row['cycletype']; ?>" selected ><? echo $row['cycletype']; ?></option>
<option>
<?=$optionscycle?>
</option>
</SELECT>
</td>
<td>
<SELECT NAME="rate<? echo $row['loadnumber']; ?>" id="rate<? echo $row['loadnumber']; ?>" class="select">
<OPTION VALUE=0 >
<?=$optionsrate?>
</option>
</SELECT>
</td>
<td><? if($row['adminstatus']="approvereject"){ if(isset($row['approvedby'])){echo "Rejected by<font color=red> ".$row['approvedby']."</font>: ".$row['lmcomments'];}} ?></td> </tr>
<? } ?>
</table>
<input type="submit" name="testupdate" id="testupdate" value="Updated selected">
<input type="submit" name="park" id="park" value="Park Selected">
</form>
如前所述,这曾经可以正常工作。现在没有了。为了进行故障排除,我从表中删除了一些行,这现在可以工作并将帖子值传递到下一页。
<form name="form1" id="form1" action="bsassigncosts.php" method="post">
<table id="hor-minimalist-a">
<tr>
<th></th>
<th>Date & Time</th>
<th><font color=red>Trailer</font></th>
<th><font color=red>Load Number</font></th>
<th><font color=red>Weight</font> kg's</th>
<th><font color=red>Source</font></th>
<th><font color=red>Destination</font></th>
<th><font color=red>Cycle Type</font></th>
<th><font color=red>Rate to be applied</font></th>
<th>LOC Status / Comments</th>
</tr>
<? while($row = $loads->fetch(PDO::FETCH_ASSOC)) { ?>
<tr>
<td><input type="checkbox" name="checkbox[]" id="checkbox[]" value="<? echo $row['loadnumber']; ?>"></td>
<td><? echo $row['sarrive']; ?></td>
<td>
<SELECT name="correctedtrailer<? echo $row['loadnumber']; ?>" id="correctedtrailer<? echo $row['loadnumber']; ?>" class="selectnarrow">
<OPTION value="<? echo $row['trailer']; ?>" selected ><? echo $row['trailer']; ?></option>
<option>
<?=$optionstrailer?>
</option>
</SELECT>
</td>
<td><input type="text" name="correctedloadnumber<? echo $row['loadnumber']; ?>" id="correctedloadnumber<? echo $row['loadnumber']; ?>" value="<? echo $row['loadnumber']; ?>" class="inputsmall"> </td>
<td><input type="text" name="correctedweight<? echo $row['loadnumber']; ?>" id="correctedweight<? echo $row['loadnumber']; ?>" value="<? echo $row['weight']; ?>" class="inputsmall"> </td>
<td><? if($row['adminstatus']="approvereject"){ if(isset($row['approvedby'])){echo "Rejected by<font color=red> ".$row['approvedby']."</font>: ".$row['lmcomments'];}} ?></td>
</tr>
<? } ?>
</table>
</form>
如果我在下面的代码中再添加一个条目,那么该帖子现在将失败。我不明白:
<td>
<SELECT name="correctedsource<? echo $row['loadnumber']; ?>" id="correctedsource<? echo $row['loadnumber']; ?>" class="selectnarrow">
<OPTION value="<? echo $row['source']; ?>" selected ><? echo $row['source']; ?></option>
<option>
<?=$optionssource?>
</option>
</SELECT>
</td>
这里的任何建议将不胜感激。如果这是一个非常简单或愚蠢的问题,我们深表歉意。
提前感谢您的时间和帮助。