此页面不工作localhost当前无法处理此请求.HTTP错误500代码点火器



我正在使用Codeigniter,每当我使用嵌套循环时,localhost都无法处理我的请求。现在我改变了我的代码策略,但遇到了同样的问题。这一次,我在里面制作了带有for循环的函数。我想从两个不同的查询中获得结果,以匹配嵌套循环中的列,或者使用函数附代码

<table class="table table-bordered table-responsive">
<?php if($allow_array ->result()){ ?>
<thead class="thead" >
<th style="width: 10%">Employee Number</th>
<th style="width: 10%">Employee Name</th>
<th style="width: 10%">Location</th>
<th style="width: 10%">Category</th>
<th style="width: 10%">Extra Work Allowance</th>
<th style="width: 10%">Hardship Allowance</th>
<th style="width: 10%">Shift Allowance</th>
<th style="width: 10%">Relocation Allowance</th>
<th style="width: 10%">Production Allowance</th>
<th style="width: 10%">Special Allowance Zin/KUP</th>
</thead>
<?php }?>
<tbody class="tbody">
<?php

$cat=" ";
$loc=" ";
$ewa=0;
$hsa=0;
$sa=0;
$ra=0;
$pa=0;
$sazk=0;

function values($cat,$loc,$ewa,$hsa,$sa,$ra,$pa,$sazk,$allow_array)
{
foreach ($allow_array->result() as $allow) {
?>
<tr>
<td style="width: 10%"><?php echo $allow->emp_no; ?></td>
<td style="width: 10%"><?php echo $allow->emp_name; ?></td>
<td style="width: 10%"><?php echo $allow->loc_name; ?></td>
<td style="width: 10%"><?php echo $allow->category; ?></td>
<td style="width: 10%">
<?php if (($allow->category == $cat) && ($allow->loc_name == $loc) && ($ewa > 0)) { ?>
<input size="5" type="number" min="0" max="99"
value="<?php echo $allow->extra_work_allowance; ?>"
name="">
<?php } ?>
</td>
<td style="width: 10%">
<?php if (($allow->category == $cat) && ($allow->loc_name == $loc) && ($hsa > 0)) { ?>
<input size="5" type="number" min="0" max="1"
value="<?php echo $allow->hardship_allowance; ?>"
name="">
<?php } ?>
</td>
<td style="width: 10%">
<input size="5" type="number" min="0" max="99"
value="<?php echo $allow->shift_allowance; ?>"
name="">
</td>
<td style="width: 10%">
<input size="5" type="number" min="0" max="1"
value="<?php echo $allow->relocation_allowance; ?>"
name="">
</td>
<td style="width: 10%"><input size="5" type="number" min="0" max="99"
value="<?php echo $allow->production_allowance; ?>"
name=""></td>

<td style="width: 10%"><input size="5" type="number" min="0" max="99"
value="<?php echo $allow->special_allowance_zin_kup; ?>"
name=""></td>
<input type="hidden" value="<?php echo $allow->emp_no ?>" name="empname">
</tr>
<?php
}
}
foreach ($allowed_allowances as $allowances) {
$cat = $allowances->category;
$loc = $allowances->loc_name;
$ewa = $allowances->extra_work_allowance;
$hsa = $allowances->hardship_allowance;
$sa = $allowances->shift_allowance;
$ra = $allowances->relocation_allowance;
$pa = $allowances->production_allowance;
$sazk = $allowances->special_allowance_zin_kup;
values($cat,$loc,$ewa,$hsa,$sa,$ra,$pa,$sazk,$allow_array);
}
?>
</tbody>
</table>

我也尝试配置Xampp服务器,但它没有解决问题

您应该尝试启用错误报告或检查apache错误日志,这样您就可以获得代码错误的详细信息。

最新更新