Obi1-Cannabis Posted March 19, 2009 Share Posted March 19, 2009 heyas,i'm using an iframe to show a php page, this page gets a pdf file from database and displays it.this iframe works alright in ie7, opera9 and chrome (these are the ones i've tried) but in firefox the iframe just stay white and show nothing.i've tried to use object instead, at first it works with firefox but then it brakes the page and gives error making me close firefox, and it does not work with other browsers.is there any solution to make this work ok? Link to comment Share on other sites More sharing options...
Ingolme Posted March 19, 2009 Share Posted March 19, 2009 Are you sending the correct header with PHP? header("Content-type: application/pdf"); Link to comment Share on other sites More sharing options...
ProblemHelpPlease Posted March 19, 2009 Share Posted March 19, 2009 There are various differences in the way browsers display iframes, have you got a link to the page or some code we can look at, makes problem solving a lot easier;) Link to comment Share on other sites More sharing options...
Obi1-Cannabis Posted March 19, 2009 Author Share Posted March 19, 2009 yes i'm sending the corect header with php.and here is the code:xHTML & smarty {foreach item=idioma from=$idiomas key=idiomaKey} <div> <iframe class="media" id="media-{$idiomaKey}" src="{$wwwroot}/ementas/ficheiroEmenta.php?idmenu={$menu.idmenu}&ididioma={$idioma.ididioma}"></iframe> </div>{/foreach} PHP require_once($_SERVER["DOCUMENT_ROOT"] . "/classes/lib/menu.inc.php");$menuObj = new Menu();$menuObj->idmenu = $_REQUEST["idmenu"];$menuObj->ididioma = $_REQUEST["ididioma"]; $file = $menuObj->GetFileMenu(); $ficheiro = $file["ficheiro"]; header("Content-type: application/pdf"); print $ficheiro; Link to comment Share on other sites More sharing options...
Obi1-Cannabis Posted March 19, 2009 Author Share Posted March 19, 2009 i still don't no what the problem was, but now that i'm changing the src when i click a tab it works. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.