Re: .htpasswd?
| From: | Cody Caughlan | Date: | Mon, 05 Feb 2001 03:53:11 +0000 |
| Subject: | Re: .htpasswd? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-6382@lists.php.net to get a copy of this message | ||
You could also run something like:
system("htpasswd -b passwordilf $user $password"),,,basically get the shell to
run a the htpasswd program supplied by apache. you might have to play around
with the permissions to do this, so the webserver can execute the htpasswd
binary.
/cody caughlan
Victor Foitzik wrote:
> 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
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net