Can anyone advice me any to realize a directory authentication with
Apache/php4.0.6/MySQL ?
I mean that Apache must to use MySQL database for authentication..
plz :)

i have made an 'access.php' that contains:


---------------------------
function deny() {
 header("WWW-Authenticate: Basic realm=\"My Realm\"");
 header("HTTP/1.0 401 Unauthorized");
 die ("sorry, access denied\n");
}

if(isset($PHP_AUTH_USER)) {
 $showqueries = 0;
 $user = $db->query("SELECT nick, email FROM members WHERE name =
'$PHP_AUTH_USER' AND pass = PASSWORD('$PHP_AUTH_PW')");
 $row = $user->fetch();
 if (!isset($row->nick)){
  deny();
 }
} else {
 deny();
}
-----------------------------

but this means , that i need to inlcude this file to _all_ php-files in
'secure' directory :(



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to