Lets say I have the following file:
layout.php
<?php
session_start();
?>
<table width="700" border="1" cellspacing="0" cellpadding="0">
<tr>
<th>Id</th>
<th>Nombre</td>
</tr>
<tr>
<td><?php echo $_SESSION['id']; ?></td>
<td><?php echo $_SESSION['nombre']; ?></td>
</tr>
</table>
Is there a way where I can download that file as a PDF that will output the file like you see it in the browser?
I tried this but it didnt work:
<?php
session_start();
header("Content-type:application/pdf");
header("Content-Disposition:attachment;filename=info_user.pdf");
readfile('layout.php');
?>