打印以 php 形式输入的文本


Print text inputted in a php form

我在表单中输入了一个文本,当我单击打印时,它应该按照表格格式在该文本字段中打印我在该文本字段中输入的文本。我对如何从 php 文件捕获数据有问题。PFDF 这是我的代码:

<?php 
$html = <<<MYTABLE 
<table border="1" style="width:90%" title="Leave" cellpadding="5px" align="center"> 
<tr> 
<td rowspan=1 width="70" align:"top-left"><center><b>1. Office/Agency</b>    </center><br><select name="office_agency"></td> 
<td rowspan=1 width="100" colspan="2" align:"top-left"><b>2. ID&nbsp;&nbsp; / &nbsp;&nbsp;&nbsp; Name</b><br> </td> 
</tr> 
<tr> 
<td rowspan=1 align:"top-left"><b>3. Date of Filing:</b><br></td> 
<td rowspan=1 align:"top-left"><b>4. Position</b><br></td> 
<td rowspan=1 align:"top-left"><b>4. Salary</b><br></td> 

..........

MYTABLE; 
require('pdftable.inc.php'); 
mysql_connect('localhost','root',''); 
mysql_select_db('auth'); 
$p = new PDFTable(); 
$p->AddPage(); 
$p->setfont('times','',10); 
$p->Cell(5,-5,' APPLICATION FOR LEAVE'); 
$p->Ln(3); 
$p->htmltable($html); 
$p->output(); 
?>

你需要使用 Write() 将内容写入页面

$pdf->Write("content here");

编写文档