*/ $after_url = "ok.htm"; # ############################################################################## if(empty($_GET) && empty($_POST)) { die('Please do not access this file directly. Visit dodo\'s scripts collection for more information!'); } // emular register_globals on if (!ini_get('register_globals')) { $superglobales = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET); if (isset($_SESSION)) { array_unshift($superglobales, $_SESSION); } foreach ($superglobales as $superglobal) { extract($superglobal, EXTR_SKIP); } } // to prevent header injection if (eregi("\r",$_POST['your_email_address']) || eregi("\n",$_POST['your_email_address'])){ exit('Please do not exploit this file. Visit dodo\'s scripts collection for more information!'); } // clean & test exploits foreach ($_POST as $key => $val) { if(is_string($val)) { $c[$key] = clean($val); testExploit($val); } else if(is_array($val)) { foreach($val as $vKey => $vVal) { $c[$key][$vKey] = clean($vVal); testExploit($vVal); } } } $fields = array_keys($c); // protect the variable $reserved_vars if(isset($reserved_vars)) { unset($reserved_vars); } $reserved_vars = array("css_file", "background_color", "background_image", "text_color", "link_color", "visited_link_color", "active_link_color", "font_name", "font_size", "highlight_color", "required_fields", "after_url", "check_email_address", "subject", "your_email_address", "env_report", "owner_name", "autoresponse", "response_subject", "response_mail", "dodosmail_header_file", "dodosmail_footer_file", "use_dodos_captcha", "use_dodos_captcha_typed"); // checking required fields // in case they used comma and space, replace if(strstr($required_fields, ", ")) { $required_fields = str_replace(", ", ",", $required_fields); } else { $required_fields = $required_fields; } $required_fields = explode(",", $required_fields); for($i = 0; $i < count($required_fields); $i++) { $required_var_name = $required_fields[$i]; ########## era aquí ################################# # $required_var_name = strProper($required_var_name); ########## era aquí ################################# if(empty($$required_var_name)) { include_dodosmail_header($dodosmail_header_file); echo "

Error - No has llenado el campo obligatorio ".dodosmail_error_handle($required_var_name)." \n"; echo "

Back\n"; echo "

\n"; include_dodosmail_footer($dodosmail_footer_file); exit; } } if($check_email_address == "yes" && !empty($email)) { if(!check_email($email)) { include_dodosmail_header($dodosmail_header_file); echo "

Error - la casilla ".dodosmail_error_handle($email)." no es válida.\n"; echo "

Back\n"; echo "

\n"; include_dodosmail_footer($dodosmail_footer_file); exit; } } if($use_dodos_captcha == "yes" && !dodoscaptcha_verify($use_dodos_captcha_typed)) { include_dodosmail_header($dodosmail_header_file); echo "

Error - el texto de protección anti-spam ".dodosmail_error_handle($use_dodos_captcha_typed)." que ingresaste no coincide con el que se muestra en color .\n"; echo "

Back\n"; echo "

\n"; include_dodosmail_footer($dodosmail_footer_file); exit; } for($i = 0; $i < count($fields); $i++) { $actual_var = $fields[$i]; if(in_array($actual_var, $reserved_vars)) { $inside_mail = $inside_mail; } else { if(is_array($$actual_var)) { $inside_mail.= "$actual_var: "; foreach($$actual_var as $actual_val) { $inside_mail.= "$actual_val "; } $inside_mail.= "\n"; } else { $actual_val = stripslashes($$actual_var); $inside_mail.= "$actual_var: $actual_val\n"; } } } // getting other information from the form $cname = gethostbyaddr($_SERVER[REMOTE_ADDR]); $inside_mail.= " --------------------------------------------------------------------------------- SENDER INFO: IP: $_SERVER[REMOTE_ADDR] Computer Name: $cname Server Name: $_SERVER[SERVER_NAME] Remote Host: $_SERVER[REMOTE_HOST] Browser Type: $_SERVER[HTTP_USER_AGENT] Page Referer: $_SERVER[HTTP_REFERER] Request URI: $_SERVER[REQUEST_URI] --------------------------------------------------------------------------------- "; /* Powered by DodosMail 2.5 http://regretless.com/scripts */ ################################################################ # puse aquí este trozo para recuperar el nombre de quien envía # el mensaje y poderlo poner en la respuesta # # $nnombre = ucfirst($name); # $name = strProper($name); $name = strProper($nombre); // ver función más abajo /* $response_mail = "Hola " . $name . ".\n\nGracias por visitar mi página.\n\nSi tu mensaje requiere una respuesta, la recibirás dentro de poco en tu e-mail.\n\nEntretanto, te invito a que explores dentro de la http://pagina.de/glia ,\nespero que encuentres algo que te interese.\n\n-- \nSaludos!\nglia@pagina.de\n"; */ $response_mail = "Hola $name.\n\nGracias por visitar mi página.\n\nSi tu mensaje requiere una respuesta, la recibirás dentro de poco en tu e-mail.\n\nEntretanto, te invito a que explores dentro de la http://glia.freeshell.org/ ,\nespero que encuentres algo que te interese.\n\n-- \nSaludos!\nglia@freeshell.org\n"; ################################################################ $headers .= "MIME-Version: 1.0\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: DodosMail 2.5\n"; $headers .= "Content-type: text/plain; charset=\"iso-8859-1\"\n"; // $headers .= "From: $name <$email>\n"; // $headers .= "From: " . strProper($name) . "<$email>\n"; // $headers .= "From: " . $name . "<$email>\n"; $headers .= "From: $name <$email>\n"; // $headers .= "Reply-To: $name <$email>\n"; // $headers .= "Reply-To: " . strProper($name) . "<$email>\n"; // $headers .= "Reply-To: " . $name . "<$email>\n"; $headers .= "Reply-To: $name <$email>\n"; $success = mail($your_email_address, $subject, $inside_mail, $headers); if($success) { if($autoresponse == "yes") { $response_subject = stripslashes($response_subject); $response_mail = stripslashes($response_mail); mail($email, $response_subject, $response_mail, "From: $owner_name <$your_email_address>"); } if($after_url == "") { // out put send info include_dodosmail_header($dodosmail_header_file); echo "

\n"; echo "El siguiente email ha sido despachado corectamente!

\n

DodosMail v2.5

"; include_dodosmail_footer($dodosmail_footer_file); exit; } else { headfunction($after_url); } } else { include_dodosmail_header($dodosmail_header_file); echo "

Error - este programa de correo tiene dificultades técnicas.\n
Por favor, envia tu mensaje a la casilla ".dodosmail_error_handle($your_email_address)." usando un programa de correos convencional.\n"; echo "

Back\n"; echo "

\n"; include_dodosmail_footer($dodosmail_footer_file); exit; } ################################################################################ # function converts any series of (english) spanish words to Proper Casing. # It also accounts for words such as 'a' and 'the'. # To change what words are ignored, just change the $noUp array. ################################################################################ # function strProper($str) { $noUp = array('a','an','of','the','are','at','in','y','de','del','el','la','lo','los','las','en'); $str = trim($str); $str = strtoupper($str[0]) . strtolower(substr($str, 1)); for($i=1; $i\n"; echo "\n"; echo "\n"; echo "DodosMail\n"; echo "\n"; if($css_file != "") echo "\n"; echo "\n"; echo "\n"; echo "\n"; } } function include_dodosmail_footer($dodosmail_footer_file) { global $reserved_vars; foreach($reserved_vars as $reserved_var) { global $$reserved_var; } if(is_file($dodosmail_footer_file)) { include_once($dodosmail_footer_file); return; } else { echo "\n\n"; } } function dodosmail_error_handle($msg) { global $highlight_color; if(isset($highlight_color)) { $extra_begin = ""; $extra_end = ""; } else { $extra_begin = ""; $extra_end = ""; } return $extra_begin.$msg.$extra_end; } function headfunction($url) { header ("Location: $url"); } /***************************************************************************** /* Other functions *****************************************************************************/ function clean($data) { $data = stripslashes($data); $data = strip_tags($data); $data = trim(htmlspecialchars($data)); return $data; } function testExploit($var) { $exploits = "/(content-type|bcc:|cc:|document.cookie|onclick|onload|mime-version:|content-transfer-encoding:)/i"; if(preg_match($exploits, $var)) { exit('Please do not exploit this file. Visit dodo\'s scripts collection for more information!'); } } function check_email($email) { if( (preg_match('/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/', $email)) || (preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',$email)) ) { return true; } return false; } function dodoscaptcha_verify($typed) { session_start(); $ans = false; if($typed === $_SESSION['captcharand_string']) { $ans = true; setcookie(session_name(), '', time()-36000, '/'); $_SESSION = array(); session_destroy(); } return $ans; } ?>