我有一个回显的表格:
echo "<form action= 'mypdf.php' method='post' name='print' target='_blank' >";
for($x=0; $x<$N; $x++){
echo nl2br("<tr>
<td><textarea name=unit[]>$bute[$x]</textarea></td>
<td><textarea name=final[]></textarea></td>
<td><textarea name=act[];></textarea></td>
}
echo "<input type='submit' name='Submit' value='Submit'></br></form>";
我在为 FPDF 开发参数以显示表单内容时遇到问题。表单的内容不存储在数据库中。
<?php
require('fpdf.php');
class PDF extends FPDF {
function BuildTable($header,$data) {
$this->SetFillColor(255,0,0);
$this->SetTextColor(255);
$this->SetDrawColor(128,0,0);
$this->SetLineWidth(.3);
$this->SetFont('','B');
$w=array(85,40,15);
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'C',1);
$this->Ln();
$this->SetFillColor(175);
$this->SetTextColor(0);
$this->SetFont('');
$fill=true;
foreach($data as $row)
{
$this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);
$this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);
$this->Cell($w[2],6,$row[2],'LR',0,'C',$fill);
$this->Ln();
$fill =! $fill;
}
$this->Cell(array_sum($w),0,'','T');
}
}
$data[] = array(($_POST['unit']), ($_POST['final']), (['act']));
$pdf = new FPDF('L', 'in', 'A4');
$header=array('Attributes','Outcome','Activites');
$pdf->SetFont('Arial', 'B', 10);
$pdf->AddPage();
$pdf->BuildTable($header,$data);
$pdf->Output();
?>
请问有人可以帮忙吗。谢谢