Re: Embed word, excel and pdf documents

From: Date: Tue, 14 Jan 2003 16:50:22 +0000
Subject: Re: Embed word, excel and pdf documents
Groups: php.install 
Request: Send a blank email to php-install+get-9695@lists.php.net to get a copy of this message
There is no way that I am aware to just stop/pause what type of document you are printing (which if you are embedding, then you have already started a document of type text/html) and put another document type. However, there are two types of solutions for this one: If what you are displaying are images from a database, then you could use the IMG tag of html with a SRC attribute of something like "mypage.php?ImgID=239" and then from that PHP page do your image pull from the database, respond with a header of "image/jpeg" or whatever for that type of image and then the binary contents. If, from you message, you are really displaying things like Word/Excel, PDF, etc. you will need to create an IFRAME or LAYER tag to get another page onto a page with the page location being "mypage.php?DocID=####" and then responding with the appropriate header and then outputting the binary contents. For either solution, the easiest way is to say to yourself, "How would I get the particular document type from the filesystem into this HTML page?" and then just do that, but replace the part where you specify the filesystem document with your SECOND php page that returns the document from the database. "William Cheung" <william@databyte.com> wrote in message news:001001c2bb2b$dd7b0510$3d6ea8c0@databyte.com... I have stored Word, Excel and PDF documents in a database. Now I am trying to retrieve the documents from the database using PHP and embed them onto an html web page. I don't want to use hyperlink. The documents will be displayed on the web page along with other information. When I use header() function to specify the type of document I want to display in PHP. I got the error saying that I can't change the header information on a web page. I tried to set the second parameter of header() to True/False but none help. What could I do? William Cheung, B.Sc. MCSE MCDBA Databyte Corp. -- Stephen Cuppett, CEO WebMasters, Inc. http://www.webmastersinc.org stephen.cuppett@webmastersinc.org (814) 571-4987

« previous php.install (#9695) next »