Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/06/2013, 22:09
orianay
 
Fecha de Ingreso: febrero-2007
Ubicación: Caracas-Venezuela
Mensajes: 19
Antigüedad: 17 años, 2 meses
Puntos: 0
Pregunta No funciona el boton enviar

Buenas Noches!! Soy algo novata en esto pero he hecho algunos formularios y han funcionado muy bien, pero esta vez no me funciona y después de muchos intentos sigue sin funcionar, al principio al montarlo en el servidor no me enviaba el correo pero me hacia las validaciones, pero ahora no hace nada

Aquí dejo el codigo, si alguien me puede ayudar se lo agradecería

Código HTML:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulario 8d2</title>
<link href="css/css_formulario8d2.css" rel="stylesheet" type="text/css" />
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'></script>
<script src='scripts/funciones.js'></script>
</head>

<body>
<section id="formulario-contacto">
[PHP]
    <?php
    if(isset($_POST['enviar'])){
		
    	if($_POST['nombre'] == ''){
   		$errors[1] = '<span class="error">Ingrese su nombre</span>';
		}
		else if($_POST['email'] == "" or !preg_match("/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/",$_POST['email'])){
    	$errors[2] = '<span class="error">Ingrese un email correcto</span>';
    	}
		else if($_POST['telefono'] == ""){
    	$errors[3] = '<span class="error">Ingrese un teléfono</span>';
   	 	}
		else if($_POST['comentario'] == ''){
    	$errors[4] = '<span class="error">Agregue un mensaje</span>';
    	}
		else{
    		$dest = "[email protected]"; 
    		$nombre = $_POST['nombre'];
    		$email = $_POST['email'];
			$telefono = $_POST['telefono'];
			$asunto = "Mensaje desde la Web"; 
			$comentario = $_POST['comentario']; 
			
			$mensaje = "Tel&eacute;fono: ".$telefono;
			$mensaje .= "<br>".$comentario;
			$mensaje_code = utf8_decode($mensaje);
			
			$body_top  = "--Message-Boundary\n"; 
			$body_top .= "Content-type: text/html; charset=US-ASCII\n"; 
			$body_top .= "Content-transfer-encoding: 7BIT\n"; 
			$body_top .= "Content-description: Mail message body\n\n";
			
			$cuerpo = $body_top.$mensaje_code;
			
    		
    		$headers = "From: $nombre $email\r\n";
    		$headers .= "X-Mailer: PHP5\n";
			//$headers .= "Reply-To: ".$_POST["email"]."\n";
    		$headers .= 'MIME-Version: 1.0' . "\n";
			$headers .= "Content-type: multipart/mixed; "; 
			$headers .= "boundary=\"Message-Boundary\"\n"; 
			$headers .= "Content-transfer-encoding: 7BIT\n"; 
			$headers .= "X-attachments: $nombref"; 

			
			//mail($dest,$asunto,$cuerpo,$headers);              
            
     		if(mail($dest,$asunto,$cuerpo,$headers)){
    		$_POST['nombre'] = "";
    		$_POST['email'] = "";
   			$_POST['telefono'] = "";
    		$_POST['comentario'] = "";
			$result = '<div class="result_ok">Email enviado correctamente </div>';
    		}
			else{
    		$result = '<div class="result_fail">Error al enviar el mensaje </div>';
    		}
    	}
    }
    ?>
[/PHP]
	<form name="formulario" class="contacto" method="post" enctype="multipart/form-data" action="">
		<fieldset>
			<label>Nombre</label>
			<input name="nombre" type="text" value="<?php echo $_POST['nombre']; ?>"/>
            <?php echo $errors[1] ?>
			<label>E-mail</label>
			<div><input name="email" type="text" value="<?php echo $_POST['email']; ?>"/></div>
            <?php echo $errors[2] ?>
			<label>Teléfono</label>
			<input name="telefono" type="text" value="<?php echo $_POST['telefono']; ?>"/>
            <?php echo $errors[3] ?>
			<label>Mensaje</label>
            <textarea name="mensaje" cols="30" rows="7" wrap="virtual"><?php echo $_POST['comentario']; ?></textarea>
            <?php echo $errors[4] ?>
            	<input name="enviar" type="submit" value="enviar" class="boton_enviar" />
			<?php echo $result; ?>
		</fieldset>
	</form>
</section>
</body> 
Gracias por adelantado!!