|
Posted by Tommy Gildseth on 11/19/30 11:45
psion wrote:
>
> P.S. I have tried what I think would be best, which is to display a pdf
> file by "printing" it with the php file, ie:
>
> $file_contents = file_get_contents('$filename');
> header('Content-type: application/pdf');
> print $file_contents;
>
> but I get an error, stating that the pdf file can't be displayed
> because it may be corrupt, and it isn't. Was anyone successful in doing
> something like this?
The reason you get an error, is because you are trying to read the
content of the file named $filename, as opposed to the file named
whatever the variable $filename contains. Check up on the difference
between single ' and double " quotes. Another thing is that you
shouldn't be using quotes at all in this case. The line should read
something like this:
$file_contents = file_get_contents($filename);
--
Tommy Gildseth
http://design.twobarks.com/
[Back to original message]
|