"\u0020", "_" => "\u005f", "@" => "\u0040", "a" => "\u0061", "b" => "\u0062", "c" => "\u0063", "d" => "\u0064", "e" => "\u0065", "f" => "\u0066", "g" => "\u0067", "h" => "\u0068", "i" => "\u0069", "j" => "\u006a", "k" => "\u006b", "l" => "\u006c", "m" => "\u006d", "n" => "\u006e", "o" => "\u006f", "p" => "\u0070", "q" => "\u0071", "r" => "\u0072", "s" => "\u0073", "t" => "\u0074", "u" => "\u0075", "v" => "\u0076", "w" => "\u0077", "x" => "\u0078", "y" => "\u0079", "z" => "\u007a", "." => "\u002e" ); /* -------- Funciones ---------- */ function convertASCIItoUNICODE($cadena) { global $UNICODE; $result = ""; for ($i = 0;$i < strlen($cadena); $i++) { $result .= $UNICODE[$cadena[$i]]; } return $result; } // convertASCIItoUNICODE function RandomLetters($n) { $abcd = Array("a","b","c","d","e", "f","g","h","i","j","k","l","m", "n","o","p","q","r","s","t","u", "v","w","x","y","z"); if ($n < 1) { $n = 1; } $text = ""; for ($i = 1; $i <= $n; $i++) { $text = $text . $abcd[rand(0,25)]; } // for return $text; } // RandomLetters function getFileExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } // getFileExtension /* ----------- Proceso ----------- */ session_start(); $letras = strtoupper(RandomLetters(4)); $_SESSION['captcha'] = $letras; $limite = time() - 600; // tiempo límite 10 minutos $dir = opendir("."); while (($archivo = readdir($dir)) !== false) { if (($archivo[0] == "_") and ($archivo[7] == "_") and (getFileExtension($archivo) == "php")) { // toma la fecha y hora de creación del archivo $ft = filemtime($archivo); // si es menor al tiempo límite lo borra if ($ft < $limite) { unlink($archivo); } } // if } // while closedir($dir); // crea un nuevo nombre de archivo. $NomArchValidador = "_" . RandomLetters(6) . "_.php"; // copia el validador original copy("validador.php",$NomArchValidador); ?> Formulario de contacto.



escribe estas letras