You are here: Re: What function? « PHP Programming Language « IT news, forums, messages
Re: What function?

Posted by Jerry Stuckle on 10/19/07 12:55

Henri wrote:
> On Fri, 19 Oct 2007 14:06:48 +0200, salonowiec wrote:
>
>> Uzytkownik "Jean-Baptiste Nizet" <jnizet@gmail.com> napisal w wiadomosci
>> news:1192794161.771509.304950@y27g2000pre.googlegroups.com...
>>
>>> If what you want to do is sending a gif, jpeg, pdf file or whatever
>>> file to the browser and the browser displays it as it would if you had
>>> clicked on a direct link to the file, then you must send the mime type
>>> of the file in the HTTP response:
>>>
>>> header("Content-Type: image/gif");
>>>
>>> for a gif file, for example.
>>>
>>> With direct links, the web server does it automatically, but if you
>>> want to do it in PHP, you have to do it yourself. Read the user
>>> comments on http://www.php.net/readfile to see some examples.
>>>
>>> JB.
>>>
>> It's working good with this header function, it displays O. K. There is
>> another question (I'm probably stubborn): the address line shows
>> something like http://www.xxx/vvv/alpha.pdf. And this is my problem -
>> can I "force" system (server, browser?) to keep showing
>> http://......something.php ? The true reason for this is, that in my PHP
>> script I put the code that redirects unlogged user to somewhere. But
>> when you remember once only the address http://......./alpha.pdf you
>> will reach it any time without logging. Sorry, I'm not sure if it's
>> clear enough...
>
> you can use sessions to check if the user is authorized (eg logged in or whatever) to view the content.
> Just to this check before actually displaying any content.
>

Not if the user is directly accessing a non-php file, i.e. a pdf.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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