php - TCPDF - Pass get parameter to HTML page

I've used TCPDF library to generate PDF from HTML. Here, In the URL there are few GET parameters and I have to pass those parameters to my html content,
Here is the code sample,
Loading URL http://localhost/test/index.php?name=Alex
index.php
<?php
require_once 'tcpdf_import.php';
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setPrintHeader(false);
$pdf->AddPage();
$html = file_get_contents('./content.php');
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
$pdf->Output('five-min-pdf.pdf', 'I');
?>
content.php
<!DOCTYPE html>
<html>
<head>
<title>TCPDF Example</title>
</head>
<body>
<div id="divIdToPrint">
<h3>Header 1</h4>
<h4><?php $_GET['name']; ?></h4>
</div>
</body>
</html>
Any suggestions how can I pass'name'
parameter to html page?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot use isset() on the result of an expression (you can use "null !== expression" instead)
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.