I am creating a button, that on click it views the PDF uploaded in the MySQL database in new window here's my code:
Button:
<td><a href='view.php?id={$row['id']}'>View</a></td>
view.php:
<?php
header('Content-type: application/pdf');
echo $pdf_from_database;
the code seems to work and newtab is started, adope start loading, and then I get an error:
file does not begin with "%pdf-"
Anyone knows how to solve the problem?