Re: .htpasswd?

From: Date: Mon, 05 Feb 2001 02:01:15 +0000
Subject: Re: .htpasswd?
References: 1  Groups: php.db php.general 
Request: Send a blank email to php-general+get-38176@lists.php.net to get a copy of this message
James Smith wrote: >Is there a way that when a user signs up for a >user/pass on a site, to automatically update the >.htpasswd on the site? Right now I'm running a Win2k >Pro, with Apache installed and MySQL/PHP. > >Thanks, > >James The quite simpliest method is to put appropriate directives in a .htaccess file in appropriate (e.g. to be protected) directories like this: AuthName "Restricted Area" AuthUserFile /www/users/users AuthGroupFile /www/users/groups AuthType Basic Require registeredusers Then all you have to do is to regenerate the user and the group file according to your needs. Another way to do this directly with MySQL is to use the apache auth_mysql module which allows you to store authentication data in a MySQL DB. See http://mysql.com/downloads/contrib.html and http://httpd.apache.org/docs/misc/FAQ-G.html for more info. HTH Victor

« previous php.general (#38176) next »