// Parse form variables $crlf = $_POST['crlf']; function NewLine() { global $crlf; echo ($crlf == "on") ? "\r\n" : "\n"; } function SwapString($string, $newstring,$birthday, $numbers) { $array = array ('a' => 'aA4@', 'b' => 'bB', 'c' => 'cC', 'd' => 'dD', 'e' => 'eE3', 'f' => 'fF', 'g' => 'gG', 'h' => 'hH', 'i' => 'iI1', 'j' => 'jJ', 'k' => 'kK', 'l' => 'lL', 'm' => 'mM', 'n' => 'nN', 'o' => 'oO0@', 'p' => 'pP', 'q' => 'qQ', 'r' => 'rR', 's' => 'sS5$z', 't' => 'tT7', 'u' => 'uU', 'v' => 'vV', 'w' => 'wW', 'x' => 'xX', 'y' => 'yY', 'z' => 'zZ' ); $specialchars = "$&@%=+_^*!#/ยง{}[]()"; $letter = str_split($string); $car = strlen($newstring); if ($car == strlen($string)) { if ($numbers > 0) { for ($loop = 1; $loop <= $numbers; $loop++) { echo $newstring . $loop; NewLine(); } } else { if ($birthday > 0) { $day = substr($birthday, 0, 2); $month = substr($birthday, 2, 2); $year = substr($birthday, 4, 4); $age = date('Y') - $year; echo $newstring . $birthday; NewLine(); echo $newstring . "-" . $birthday; NewLine(); echo $newstring . "_" . $birthday; NewLine(); echo $newstring . $age; Newline(); echo $newstring . "-" . $age; Newline(); echo $newstring . "_" . $age; Newline(); echo $newstring . $month . $year; NewLine(); echo $newstring . $day . $month; NewLine(); echo $newstring . "-" . $day; NewLine(); echo $newstring . "_" . $day; NewLine(); echo $newstring . "-" . $age; NewLine(); echo $newstring . "_" . $age; NewLine(); echo $newstring . "-" . $day . "-" . $month; NewLine(); echo $newstring . "_" . $day . "_" . $month; NewLine(); } else { echo $newstring; NewLine(); } } return; } $found = 0; if ($array[$letter[$car]] != "") { if (strpos($array[$letter[$car]], $letter[$car]) >= 0) { $found++; $substitute = str_split($array[$letter[$car]]); $j = 0; while (isset($substitute[$j])) { $newstring = $newstring . $substitute[$j]; SwapString($string, $newstring,$birthday, $numbers); $newstring = substr($newstring, 0, $car); $j++; } } } if ($found == 0) { $newstring = $newstring . $letter[$car]; SwapString($string, $newstring, $birthday, $numbers); $newstring = substr($newstring, 0, $car); } } if (strlen($_POST['name']) > 0) { $string = strtolower(strip_tags($_POST['name'])); $birthday = $_POST['birthday']; $numbers = $_POST['numbers']; $newstring = ""; // Generate the headers to force the browser to download the file // instead of displaying it. header('Content-disposition: attachment; filename=dict.txt'); header('Content-Type: text/plain'); header('Content-Transfer-Encoding: binary'); header('Cache-control: private'); header('Pragma: private'); SwapString($string, $newstring, $birthday, $numbers); exit; } ?>