Good Afternoon All,
I have got the code below to load a pdf document using the object tag which i am hoping to use to display a pdf document. If i set like i have done below the code to statically load a document it works successfully and displays the document perfectly.
<object data="pdfs/Double Pent Store.pdf#toolbar=1" type="application/pdf" width="100%" height="700px"></object>
However when i try and use this in an echo within a php statement (below)
if (mysqli_num_rows($result) > 0 ) {
while($row = mysqli_fetch_assoc($result)) {
echo "<object data='pdfs/" .$row["menu_name"]. ".pdf#toolbar=1' type='application/pdf' width='100%' height='700px'></object>";
}
} else {
echo "Please select a product from the product menu";
}
This code doesn’t display anything at all.
I have tried using a basic echo (echo "Document = pdfs/" .$row["menu_name"]. ".pdf#toolbar=1";)
to check that the $row[menu_name]
is getting the data from the database correctly and this is all working and displays Document = pdfs/Double Pent Store.pdf#toolbar=1.
Is someone able to assist with this as to where i am going wrong.
Thanks in advanced
Luke