php - XAMPP iframe not working inside localhost
I am trying to use an iframe to embed a pdf into a webpage. for some reason the pdf wont display (appears blank) and i'm prompted to download the file. This happens when i run the code from localhost server. however if i run the code outside localhost the iframe displays the pdf doc as it should. i have also tried using
<object> and pdf.js they all gave the same outcome.
echo'<div class="main_content_view"> <iframe src="pdf/pdf1.pdf" id="pdf_content" width="700px" height="800px"> </iframe> </div> ';
i've also tried adding
$cfg['AllowThirdPartyFraming'] = true; to the config.inc.php and it still didnt work. Any ideas on how i could get the pdf to display in localhost as it does when i right click and open the php directly with a browser?