note 14093 modified in function.exec by danbrown

From: Date: Sun, 04 Jan 2009 16:39:13 +0000
Subject: note 14093 modified in function.exec by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148824@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). <?php system("perl -e \"print \\\"$UserName:\\\" . crypt('$Password', join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]) . \\\"\\n\\\";\" >> $path_to_pass_file"); ?> --was-- 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://php.net/manual/en/function.exec.php

« previous php.notes (#148824) next »