IMHO the characters 1 and 0 should be left out as they can be confused with l and O...
This is my passwdgenmachinefunctionthingymajig...
PHP Code:
function create_random_password($len=7){
$chars = "abcdefghijkmnpqrstuvwxyz23456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= $len) {
$num = rand() % 33;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}