Forum Moderators: coopster

Message Too Old, No Replies

authenticating

using headers and apache

         

John_Keates

8:53 pm on Jan 2, 2006 (gmt 0)

10+ Year Member



hey,

I'd like to make some authentication system for a web dir using php. Like the Directory directive in apache where you just set the auth type and it's locked. Is this possible to do with php? I don't want to use sessions of coockies but just make php tell apache to ask for authentication without havinf to set it in the httpd.conf. So I keep a user database managed with php but have apache do the authentication stuff. Is that possible to do?

jc_armor

2:08 am on Jan 3, 2006 (gmt 0)

John_Keates

5:18 pm on Jan 3, 2006 (gmt 0)

10+ Year Member



That's what I know was possible, but the problem is when someone tries
/protected/index.php it will get the message, but /protected/files/ won't be guarded. Apache will do the whole dir, and php just one file. I need something like apache's athentication but manage the user names and passwords in a mysql database. htpasswd is now used to create a static database but I need it to be managed by a php script.

jatar_k

6:34 pm on Jan 3, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



then why not just an auth file that has the user pass in it. have each file you want to protect include that file and if the user/pass doesn't match fire them off to a login page.

John_Keates

10:17 pm on Jan 3, 2006 (gmt 0)

10+ Year Member



I don't need protection for pages, but for files. Like Downloads. I just wanted to know if php can manage apache's authentication system, but I think it can't.