Ha ver si me ayudan con esto, cada vez que apreto Enviar me pone para descargar el archivo procesar.php!!!
En home.htm:
Código:
<input name="nombre" type="text" id="nombre" value="Ingresa tu Nombre">
</p>
<p class="Estilo28"><input name="email" type="text" id="email" value="Ingresa tu email">
</p>
<form name="email" method="post" action="procesar.php">
<input type="submit" name="Submit" value="Enviar">
</form>
En procesar.php:
Código:
<?
if (isset($_POST["enviar"])){
if(empty($_POST[nombre])){
echo "Debes escribir un nombre.";
echo "<input TYPE=\"button\" VALUE=\" ATRÁS\" onClick=\"history.go(-1)\">";
}
if(empty($_POST[email])){
echo "Debes colocar tu email.";
echo "<input TYPE=\"button\" VALUE=\" ATRÁS\" onClick=\"history.go(-1)\">";
}
}
?>
<?
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Formulario enviado\n";
$cuerpo .= "Email: " . $_POST["email"] . "\n";
$subject = "$nombre - Consulta G2project";
if (mail ($to,$subject,$cuerpo))
{
header("Location:gracias.html");
exit;
} else {
header("Location:error.html");
exit;
}
?>
Gracias