title: how to embed PDF file into iframe using php
body: <p>I have simple PDF file in my directory and I use <code>fopen</code> to open PDF file. When I try to embed it on into html <code>iframe</code>, the file is not showing up. I know I can specify the source as <code>iframe</code> attribute but I want to do it using PHP.</p>
  
  <pre><code>&lt;?php
  $myfile = fopen("http://ipaddress/file.pdf", "r") or die("Unable to open file!");
  fclose($myfile);
  ?&gt;
  
  &lt;body&gt;
  &lt;iframe src="&lt;?php $myfile; ?&gt;#toolbar=0&amp;navpanes=0&amp;scrollbar=0" width="1000" height="1000"&gt;&lt;/iframe&gt;
  &lt;/body&gt;
  </code></pre>