I've a variable that contain HTML tags as string.
<table border="1">
<tr>
<td width="20">No.</td>
<td>Name</td>
</tr>
<tr>
<td>1.</td>
<td>Someone</td>
</tr>
</table>
Say, that variable name is $html_table. I want to sent that variable to TCPDF function, that's why I can't encode special characters because it needed for TCPDF to render correctly, my attempt was make a link to same page like this.
<a href="./index.php?printpdf=$html_table">Print PDF</a>
Then some code act as a handler.
if (isset($_GET['printpdf'])) {
print_page($_GET['printpdf']);
}
As you know, it's not working at all. Even the contents from $html_table not show perfectly on address bar, is there any way to solve this?
Thanks in advance.
EDIT (SOLUTIONS)
Just using session variables like @Jay Bhatt said.
$_SESSION['printpdf'] = $html_table;
I point it to same page and have some handler
if (isset($_SESSION['printpdf'])) {
print_pdf($_SESSION['printpdf']);
}
print_pdf() is function I made.