我正在创建一个 wordsearch,我试图在另一个页面中发布值,问题是我无法将所有值显示$thisChar
到另一个页面,我得到的只是最后一个字母。所以问题是你如何发布一个像这样的变量,例如,$rc[$r][$c]...
这是我的表格。我有名为 thisChar 的隐藏字段。
echo '<form method="post" action="#path" target="blank">';
echo '<table>';
#--Display the random letters and the words
for ($r=0;$r<=$row;$r++) {
echo '<tr>';
for ($c=0;$c<=$col;$c++) {
$thisChar=strtoupper($rc[$r][$c]);
echo '<input type="hidden" name="thisChar" value="'. $thisChar.'">';
echo '<td style="background:#fff">' . $thisChar . '</td>';
}
echo '</tr>';
}
echo '</table>';
echo '<input type="submit" name="submit">';
echo '</form>';
这就是我获取帖子数据的方式。我得到的只是未初始化的偏移错误。
for ($r=0;$r<=$row;$r++) {
for ($c=0;$c<=$col;$c++) {
$thisChar=$_POST['thisChar'];
$pdf->Cell(10,10, strtoupper($thisChar) ,1,0,'C', );
}
}
我已经测试了其他方法,例如 foreach 循环并在隐藏字段的名称上添加方括号并且它可以工作,现在我想使用这种方法使其工作。此方法创建一个可以在表格中显示的循环。知道如何使它起作用吗?