function makewords($numval) { $moneystr = ""; // handle the millions $milval = (int) ($numval / 1000000); if ($milval > 0) { $moneystr = getwords($milval) . " Million"; } // handle the thousands $workval = $numval - $milval * 1000000; // get rid of millions $thouval = (int) ($workval / 1000); if ($thouval > 0) { $workword = getwords($thouval); if ($moneystr == "") { $moneystr = $workword . " Thousand"; } else { $moneystr .= " " . $workword . " Thousand"; } } // handle all the rest of the dollars $workval = $workval - $thouval * 1000; // get rid of thousands $tensval = (int) $workval; if ($moneystr == "") { if ($tensval > 0) { $moneystr = getwords($tensval); } else { $moneystr = "Zero"; } } else { $workword = getwords($tensval); $moneystr .= " " . $workword; } // plural or singular 'dollar' $workval = (int) $numval; if ($workval == 1) { $moneystr .= " Pesos And "; } else { $moneystr .= " Pesos And "; } // do the pennies - use printf so that we get the // same rounding as printf $workstr = sprintf("%3.2f", $numval); // convert to a string $intstr = substr($workstr, strlen - 2, 2); $workint = (int) $intstr; if ($workint == 0) { $moneystr .= " Zero"; } else { $moneystr .= getwords($workint); } if ($workint == 1) { $moneystr .= " Cent"; } else { $moneystr .= " Cents"; } // done - let's get out of here! return $moneystr; }
$action = 'create_directory'; break; case 'file': $action = 'create_file'; } } if (sizeof($files) == 0) $action = ''; else $file = reset($files); if ($lang == 'auto') { if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2) { $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); } else { $lang = 'en'; } } $words = getwords($lang); $cols = ($win) ? 4 : 7; if (!isset($dirpermission)) { $dirpermission = (function_exists('umask')) ? (0777 & ~umask()) : 0755; } if (!isset($filepermission)) { $filepermission = (function_exists('umask')) ? (0666 & ~umask()) : 0644; } if (!empty($_SERVER['SCRIPT_NAME'])) { $self = html(basename($_SERVER['SCRIPT_NAME'])); } elseif (!empty($_SERVER['PHP_SELF'])) { $self = html(basename($_SERVER['PHP_SELF'])); } else { $self = ''; } if (!empty($_SERVER['SERVER_SOFTWARE'])) {
<?php include "settings.php"; include "header.inc"; include "functions.php"; if ($err == "") { $allwords = loadwords(); $words = getwords($allwords, $numwords); $pass = buildpass($words, $usenum, $usechar); } ?> <h1><?php echo $sitetitle; ?> </h1> <?php echo $err; ?> <p class="pass"><strong>Your Password: </strong> <?php echo $pass; ?> </p> <form method="post" action="index.php"> <p><label for="words">Number of Words: </label><input id="words" name="words" type="number" value="<?php echo $numwords; ?> " min="1" max="20" /></p> <p><label for="inc_num">Include a number?</label><input name="inc_num" id="inc_num" type="radio" value="1"<?php if ($usenum == 1) {