Re: [PHP] Re: Downloads for subsrcibers only

2007-04-01 Thread Mário Gamito
Hi,

itoctopus wrote:
> Depends where you store the file, if you store the file in the database,
> then it's much easier to do it.
> Your idea (as it is right now) won't work, because anyone will be able to
> copy and paste the link to your PDF document and download it (thus easily
> overriding the logic you have in the page).
> I've attached a class, called the FileManager class, which handles saving
> and displaying data (virtually all types) from the database. It's extremely
> easy to use. The usage is demonstrated in download.php (also attached). You
> have to add some logic in order to restrict access to your files.
Thanks a bunch.
I'll try it tomorrow at work

Warm Regards
-- 
:wq! Mário Gamito

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Downloads for subsrcibers only

2007-04-01 Thread itoctopus
Depends where you store the file, if you store the file in the database,
then it's much easier to do it.
Your idea (as it is right now) won't work, because anyone will be able to
copy and paste the link to your PDF document and download it (thus easily
overriding the logic you have in the page).
I've attached a class, called the FileManager class, which handles saving
and displaying data (virtually all types) from the database. It's extremely
easy to use. The usage is demonstrated in download.php (also attached). You
have to add some logic in order to restrict access to your files.

--
itoctopus - http://www.itoctopus.com
"Mário Gamito" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I made this site in PHP that has a page with some PDFs to download.
> My costumer wants that only subscribed people are allowed to download
> the PDFs.
>
> I've already made the subscrbe and login mechanism.
>
> Now, my question for you is about letting only subscribers download the
> PDFs.
> What is the best approach ?
> Register a session when they login and then in the PDFs page apply a
>
> if email is registered
>   you can download the PDFs
> else
>   you can't
>
> Something like this ?
> Or is it there a better way ?
>
> Any help would be appreciated.
>
> Warm Regards
> --
> :wq! Mário Gamito


begin 666 download.php
M/#]P:' -"@ES97-S:6]N7V-A8VAE7VQI;6ET97(H)VYO;F4G*3L-"@ER97%U
M:7)E*")I;F-L=61E0T*"2HO#0H)8VQA2 D9FEL
M95]H86YD;&[EMAIL PROTECTED];&4@;[EMAIL PROTECTED]&AE(&9I;&[EMAIL 
PROTECTED]&5X+B D7T9)3$536R=T
M:&5?9FEL92==*0T*"0D)*D!P87)A;2!S=')I;F<@)&9I96QD7VYA;[EMAIL PROTECTED]&AE
M(&YA;64@;[EMAIL PROTECTED]&AE(&9I96QD#0H)"0DJ0'!A7!EF4G72DI.PT*
M"0D):[EMAIL PROTECTED]"1A8W1I;VX@/3T@)W-A=F4G*7L-"@D)"0DD8W)E871I;VYD871E
M(#T@)&QA7!E+"!F:6QE7W-I>F4L(&9I;&5?F4G72XG7"7!E(&ES(&%N(&EM86=E+"!T:&5N(&-R96%T
M92!A('1H=6UB;F%I;" H7!E/5PG)RXD9FEL95]H86YD;&5;)W1Y<&4G72XG7"7!E+"!F:6QE7W-I>F4L(&9I;&5?
M8FEN87)Y([EMAIL PROTECTED]:&5R92!F:6QE7VED/5PG)RXD9FEL95]I9"XG
M7"[EMAIL PROTECTED]7!E)UTL("=I;6%G922==*3L-"@D)
M?0T*"0D-"@D)+RH-"@D)"2I 9G5N8W1I;[EMAIL PROTECTED]&5L971E#0H)"0DJ0&1EPT*"0D))'-Q;" ]("=$
[EMAIL PROTECTED])/32!F:6QE(%=(15)%(&9I;&5?:60]7"http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php