Protecting a folder?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pylon42
Forum Newbie
Posts: 5
Joined: Tue Aug 24, 2004 10:47 am

Protecting a folder?

Post by pylon42 »

Horribly new.

Can PHP do something like protect a directory so that people can't link to files in it? But links within the site to the files still function properly?

Or am I way off?

I have a directory full of .pdf files that people pay to access... but I can't seem to keep people from just downloading them directly...

thanks
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

Well err
In my opinion, you could create a log in for your users, and upon download you check if the user trying to download is actually loged in and has the right to do so.

And use .htaccess to lock you r folder up, and give access to thoses who log only.
Post Reply