elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado:


  Mostrar Temas
Páginas: [1]
1  Programación / PHP / Problema con formulario basico html y php en: 19 Octubre 2011, 01:04 am
mi problema es que ya intente modificar los codigos y no me da solucion, espero puedan ayudarme a ver que es loq ue esta mal

mis codigos son en html

Código:
<script type="text/javascript">
function enviarDatos()
{
if(confirm("¿De verdad desea enviar el formulario?"))
{
document.getElementById('formulario').submit();
}
return false;
}
</script>
<form action="enviar.php" method="post" id="formulario">
 Formulario de Contacto: <BR />
 <b>Nombre:</b>
 <input type="text" name="nombre" size="15" maxlength="70">
 <BR>
 <b>E-Mail:</b>
 <input type="text" name="email" size="18" maxlength="100">
 <BR />
<b>Teléfono:</b>
 <input type="text" name="telefono" size="15" maxlength="50">
 <BR>
 <b>Comentario:</b> <BR>
 <textarea name="coment" rows="7" cols="30"></textarea>
 <input name="c" type="hidden" value="1">
 <BR>
 <BR>
 <input type="submit" name="enviar" value="Enviar" onclick="enviarDatos(); return false;">
 <input type="reset" name ="reset" value="Borrar">
</form>

en php es
Código:
<?php
 
$mail_destinatario = 'ventascaban@gmail.com';
 
$asunto = $_POST['asunto'];
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$mensaje = $_POST['coment'];
$c = $_POST['c'];
 
$headers .= "From: ".$email. "rn";
 
if($c==1)
{
if(mail($mail_destinatario, $asunto, "Nombre: ".$nombre. "\nTeléfono: ".$telefono. "\nE-Mail: ".stripcslashes ($email)."\n Mensaje : ".stripcslashes ($mensaje), $headers))
{
echo "Mail enviado correctamente";
}
}
?>
ayuda porfavor llevo una semana y dias con este dilema
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines