note 14093 added to function.exec.php
| From: | ryan at imagesmith dot com | Date: | Tue, 17 Jul 2001 07:47:41 +0000 |
| Subject: | note 14093 added to function.exec.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15470@lists.php.net to get a copy of this message | ||
Some sites provide an htpasswd program that doesn't allow the -b switch (i.e. batch adding).
So I've used this to add a user. (This is all one line of code. Sorry it looks so intense
here).
system("perl -e \"print \\\"$UserName:\\\" . crypt('$Password', join
'', ('.', '/', 0..9, 'A'..'Z',
'a'..'z')[rand 64, rand 64]) . \\\"\\n\\\";\" >>
$path_to_pass_file");
http://www.php.net/manual/en/function.exec.php