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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database 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