I use php as a CGI from a secure location to do it all.
To add a user to .htpasswd on Apache:
$thefile=fopen("$pathtofile/.htpasswd", "a");
$newuserline="$username:" . crypt($pass) . "\n";
fwrite($thefile, $newuserline);
kind regards,
bill hollett
YoBro wrote:
> After much investigation through many newsgroups and websites, I found out
> that this is the way you can execute a unix apache command to add a user to
> the htpasswd list with PHP.
>
> Problem is, it doesn't add any information to the htpasswd file.
> Note: The example below is...
> domain = my user name
> abc = user name to add to htpasswd list
> pass = password to add to htpasswd list
>
> <?php
> passthru ("htpasswd -b /users/domain/.htpasswd abc pass");
> ?>
>
> Please Help if you can.
>
> Cheers,
> YoBro
>
> --
> PHP General 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 General 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]