I am saving my records as PDF but I want them saved by using name_empnumber like abc_123
I am using the code below and library TCFPDF
if (isset($_POST['submit'])){
require_once 'includes/practice.php';
//practice.php is using library tcfpdf
$pdf->SetFont('times', '', 15);
$tb1 = '</br></br>
<b>2- Printer:</b><br /><br />
<table cellspacing="0" cellpadding="0" border="1">
<tr style="background-color:#f7f7f7;color:#333; ">
<td width="300">SN</td>
<td width="300">TYPE</td>
</tr>
</table>';
$result= mysql_query("SELECT * FROM accessories where emp_number='".$emp_number."' && is_accessory='Printer'");
while($row = mysql_fetch_assoc($result)){
$tb2 = '<table cellspacing="0" cellpadding="2" border="1">
<tr>
<td width="300">'.$row['serial'].'</td>
<td width="300">'.$row['model'].'</td>
</tr>
</table>';
$tb1 = $tb1.$tb2;
}
$pdf->writeHTML($tb1, true, false, false, false, '');
ob_end_clean();
$pdf->Output('Report.pdf', 'D');
}
See this is saving as Report.PDF.
I want to save as name_empnumber.pdf like abc-123.pdf