include 'include_head.php'; require 'contactar_'.$_SESSION['lang'].'.txt'; $captcha_fail = 0; $sent = 0; $avisolegal = "Aviso legal"; if (isset($_POST['formulario'])) { $nombre_null = 0; $apellidos_null = 0; $emp_null = 0; //$localidad_null = 0; //$telf_null = 0; $email_null = 0; $captcha_null = 0; if ($_POST['nombre'] == NULL) $nombre_null = 1; if ($_POST['apellidos'] == NULL) $apellidos_null = 1; if ($_POST['telf'] == NULL) $telf_null = 1; //if ($_POST['tlf'] == NULL) $telf_null = 1; //if ($_POST['emai'] == NULL) $localidad_null = 1; // if ($_POST['captcha'] != $_SESSION['captcha']['code']) $captcha_null = 1; if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST['email'])) $email_null = 1; $userIP = $_SERVER["REMOTE_ADDR"]; $recaptchaResponse = $_POST['g-recaptcha-response']; $secretKey = "6LcHnikUAAAAALzFT5AOfFE0rOIUEpaZ9Sc02Hi3"; $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secretKey}&response={$recaptchaResponse}&remoteip={$userIP}"); if(!strstr($request, "true")){ $captcha_fail = 1; } else { if (($nombre_null != 1)&&($apellidos_null != 1)&&($telf_null != 1)&&($email_null != 1)) { $cabeceras = "MIME-version: 1.0\n"; $cabeceras .= "Content-type: text/html; charset=iso-8859-1\n"; $cabeceras .= "From: ".$_POST['nombre']." ".$_POST['apellidos']." <".$_POST['email'].">\n"; $cabeceras .= "Reply-To: ".$_POST['email']."\n"; $asunto = "Contacto de ".$_POST['nombre']." ".$_POST['apellidos']; $cuerpo = '
IDURGO | DATOS OBTENIDOS DEL FORMULARIO DE CONTACTO |
NOMBRE: | '.$_POST['nombre'].' |
APELLIDOS: | '.$_POST['apellidos'].' |
TELÉFONO: | '.$_POST['telf'].' |
EMAIL: | '.$_POST['email'].' |
DIRECCION: | '.$_POST['direccion'].' |
CODIGO POSTAL: | '.$_POST['cp'].' |
LOCALIDAD: | '.$_POST['localidad'].' |
PAIS: | '.$_POST['pais'].' |
ASUNTO: | '.$_POST['asunto'].' |
COMENTARIOS: | '.nl2br($_POST['nota']).' |
'; mail("webidurgo@idurgo.com",$asunto,$cuerpo,$cabeceras); //mail("rk@webrk.net",$asunto,$cuerpo,$cabeceras); $cabeceras = "MIME-version: 1.0\n"; $cabeceras .= "Content-type: text/html; charset=iso-8859-1\n"; $cabeceras .= "From: Administración
IDURGO | '.SU_MENSAJE.' |
'.GRACIAS.' '.NOS_PONDREMOS.' |
|
'; mail($_POST['email'],$asunto,$cuerpo,$cabeceras); $sent = 1; } } } #end if (!isset($_POST['formulario'])) //include("captcha/simple-php-captcha.php"); //$_SESSION['captcha'] = simple_php_captcha(); ?>
|
echo ESTAS; ?> echo CONTACTAR; ?>
if ($_SESSION['id_empresas'] == 1) { ?>