How do I access a protected directory?

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
mshita
Forum Commoner
Posts: 32
Joined: Sat Jul 03, 2004 8:55 pm
Location: Portland, OR
Contact:

How do I access a protected directory?

Post by mshita »

One of my directories in my server is password protected. Inside there are files that I do not want people to freely access. But I want to be able to use PHP code to retrieve a file once in a while and do stuff with it. How do I do that?

The folder is protected using .htaccess
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

PHP can access the files in that directory using include() or fopen() within a script. Just specify the path to them like any other file. The .htaccess file only protects access via the web server.
(#10850)
Post Reply