[PHP] Password protected directory

2010-11-02 Thread Ben Miller
I need to access and read the files in a password protected directory with a
PHP script using the readdir function.  I'm already making users login to a
secure area, so I don't want to make them enter a password again to access
the files - is there a way to include the password with the readdir/opendir
function with PHP?

 

Thanks in advance.

 

Ben



Re: [PHP] Password protected directory

2010-11-02 Thread Bastien Koert
On Tue, Nov 2, 2010 at 1:05 PM, Ben Miller  wrote:
> I need to access and read the files in a password protected directory with a
> PHP script using the readdir function.  I'm already making users login to a
> secure area, so I don't want to make them enter a password again to access
> the files - is there a way to include the password with the readdir/opendir
> function with PHP?
>
>
>
> Thanks in advance.
>
>
>
> Ben
>
>

assign a session key to the user and just check if that session key is
set before using the standard account to access the file. Then the
password can be held in the config file and the user never sees it

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Password protected directory

2010-11-02 Thread Daniel P. Brown
On Tue, Nov 2, 2010 at 13:05, Ben Miller  wrote:
> I need to access and read the files in a password protected directory with a
> PHP script using the readdir function.  I'm already making users login to a
> secure area, so I don't want to make them enter a password again to access
> the files - is there a way to include the password with the readdir/opendir
> function with PHP?

What operating system?  How is the directory password-protected
(HTTP auth, Win/SAMBA share ACLs, PHP/script control, etc.)?  Is
everything hosted on the same machine or virtual environment?

As you can tell, it's a bit difficult to give you an answer when
the question is so vague that it may as well be nonexistent.  ;-P

-- 

Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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