You are here: Re: deny direct access to a single folder with .htaccess « PHP Programming Language « IT news, forums, messages
Re: deny direct access to a single folder with .htaccess

Posted by Tommy Gildseth on 11/08/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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация