<?php
$content='<table width="100%" border="1">';
$content.='<tr><th>name</th><th>email</th><th>contact</th><th>address</th><th>city</th><th>country</th><th>postcode</th></tr>';
for ($index = 0; $index < 10; $index++) {
$content.='<tr><td>nadim</td><td>[email protected]</td><td>7737033665</td><td>247 dehligate</td><td>udaipur</td><td>india</td><td>313001</td></tr>';
}
$content.='</table>';
//$html = file_get_contents('pdf.php');
if(isset($_POST['pdf'])){
require_once('./dompdf/dompdf_config.inc.php');
$dompdf = new DOMPDF;
$dompdf->load_html($content);
$dompdf->render();
$dompdf->stream("hello.pdf");
}
?>
<html>
<body>
<form action="#" method="post">
<button name="pdf" type="submit">export</button>
<table width="100%" border="1">
<tr><th>name</th><th>email</th><th>contact</th><th>address</th><th>city</th><th>country</th><th>postcode</th></tr>
<?php for ($index = 0; $index < 10; $index++) { ?>
<tr><td>nadim</td><td>[email protected]</td><td>7737033665</td><td>247 dehligate</td><td>udaipur</td><td>india</td><td>313001</td></tr>
<?php } ?>
</table>
</form>
</body>
</html>