Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/08/2011, 17:52
alvaaz
 
Fecha de Ingreso: abril-2008
Mensajes: 63
Antigüedad: 16 años
Puntos: 1
Problema con formulario de contacto

Saludos comunidad, hago este tema porque tengo un problema con la acción de este formulario en html, resulta que tengo que hacer la acción en php pero me esta resultando un poco difícil ustedes me podrían ayudar adjuntaré el codigo html y php de la acción que tiene algo mal...

Código:
		<form id="contactform" method="post" action="contact.php" class="validateform">
			<div id="errormessage">
			</div>
			<div id="sendmessage">
				Tu mensaje ha sido enviado. ¡Gracias!
			</div>
			<ul class="cform">
				<li><label for="name">Nombre:</label>
				<input type="text" value="" name="name" id="name" class="fancyinput" data-rule="maxlen:3" data-msg="Por favor, introduzca al menos 3 caracteres" /><div class="valmsg"></div></li>
				<li><label for="email">E-mail:</label>
				<input type="text" value="" name="email" id="email" class="fancyinput" data-rule="email" data-msg="Por favor, introduzca un E-mail válido" /><div class="valmsg"></div></li>
				<li><label for="message">Mensaje:</label>
				<textarea rows="10" cols="62" name="message" class="fancyinputarea" id="message" data-rule="maxlen:10" data-msg="Por favor introduzca un mensaje"></textarea><div class="valmsg"></div></li>
				<li><input type="submit" value="Submit" class="fancybutton simple small_shadow" name="submit"/></li>
			</ul>
		</form>
PHP

Código:
<?php 
// define your emailadress here and errors here 
define("EMAIL"                ,     "[email protected]"); 
define("SUBJECT"            ,     "Mensaje del sitio web Redemprende.cl"); 
define("ERROR_MESSAGE"        ,    "Hay un error. Por favor, inténtelo de nuevo más tarde."); 

//for testing only 
//error_reporting (E_ALL ^ E_NOTICE); 

if($_POST) { 
//send email 
$email = mail(EMAIL, SUBJECT, $_POST['message'], "From: ".$_POST['name']." <".$_POST['email'].">rn" ."Reply-To: ".$_POST['email']."rn"); 

if($email) { echo 'OK';    }  else { echo '<div class="notification">'.ERROR_MESSAGE.'</div>';    } 
header("location: index_3d.php");

}     
?>
ojalá puedan ayudarme