'; echo '--> Volver al formulario
'; exit; } $secretKey = "6LdJjHwUAAAAAAfh5cV2XZnIMoNSJzbi6VH2NbB3"; $ip = $_SERVER['REMOTE_ADDR']; $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip); $responseKeys = json_decode($response,true); if(intval($responseKeys["success"]) !== 1) { echo '

spam

'; exit; } else { //echo '

Thanks for posting comment.

'; //die(); } // Initialize error array. $errors = array(); // Check for a proper First name if (!empty($_REQUEST['nombre'])) { $nombre = $_REQUEST['nombre']; $pattern = "/^[a-zA-Z0-9\_]{2,20}/";// This is a regular expression that checks if the name is valid characters if (preg_match($pattern,$nombre)){ $nombre = $_REQUEST['nombre'];} else{ $errors[] = 'Por favor ingrese su nombre nuevamente.';} } else {$errors[] = 'Por favor ingrese su nombre.';} // Check for a proper email if (!empty($_REQUEST['email'])) { $email = $_REQUEST['email']; $pattern = "/^\S+@\S+\.\S+$/";// Email validez if (preg_match($pattern,$email)){ $email = $_REQUEST['email'];} else{ $errors[] = 'Por favor ingrese su email válido.';} } else {$errors[] = 'Por favor ingrese su email.';} // Check for a proper Tel if (!empty($_REQUEST['tel'])) { $tel = $_REQUEST['tel']; $pattern = "/^[a-zA-Z0-9\_.]{2,20}/";// This is a regular expression that checks if the name is valid characters if (preg_match($pattern,$tel)){ $tel = $_REQUEST['tel'];} else{ $errors[] = 'Por favor ingrese su teléfono nuevamente.';} } // Check for a proper Textarea if (!empty($_REQUEST['mensaje'])) { $mensaje = $_REQUEST['mensaje']; $pattern = "/^[a-zA-Z0-9\_.]{2,20}/";// This is a regular expression that checks if the name is valid characters if (preg_match($pattern,$mensaje)){ $mensaje = $_REQUEST['mensaje'];} else{ $errors[] = 'Por favor ingrese su mensaje nuevamente.';} } else {$errors[] = 'Por favor ingrese su mensaje.';} } if (isset($_REQUEST['submitted'])) { if (empty($errors)) { $to = "info@sammartinoediciones.com.ar, administracion@sammartinoediciones.com.ar"; $subject = "Contacto Web SAMMARTINO Ediciones"; $mensajef = "
Mensaje:
". $mensaje . "\r\n"; $mensajef .= "

Tel/Cel de contacto: " . $tel . "\r\n"; $headers = "From:" . $nombre . "<" . $email . ">" . "\r\n"; $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; mail($to,$subject,$mensajef,$headers); } } echo '
'; //Print Errors if (isset($_REQUEST['submitted'])) { // Print any error messages. if (!empty($errors)) { echo '
';} else {echo '
';} } //End of errors array ?>

Consultas

* datos requeridos