Page 1 of 1

How do I access a protected directory?

Posted: Wed Apr 12, 2006 1:17 pm
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

Posted: Wed Apr 12, 2006 1:24 pm
by hawleyjr

Posted: Wed Apr 12, 2006 4:54 pm
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.