Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/02/2012, 22:27
Avatar de herzbazi
herzbazi
 
Fecha de Ingreso: febrero-2012
Mensajes: 612
Antigüedad: 12 años, 2 meses
Puntos: 36
Información Respuesta: Formulario PHP - Variables

aqui te dejo un codigo se divide en tres documentos

1) formulario.html

<html>
<head>
<title>Formulario de Contacto</title>
</head>

<body>
<table width="30%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="form1" name="form1" method="post" action="enviar.php">
<p>Nombre:<br />
<label>
<input name="nombre" type="text" id="nombre" />
</label>
<br />
Telefono:<br />
<input name="telefono" type="text" id="telefono" />
<br />
Email:<br />
<input name="email" type="text" id="email" />
<br />
Mensaje:<br />
<textarea name="mensaje" id="mensaje"></textarea>
<br />
<label>
<input type="submit" name="Submit" value="Enviar Formulario" />
</label>
</p>
</form></td>
</tr>
</table>
</body>
</html>

2) enviar.php



<?php

$mail='aqui colocas el correo';


$nombre = $_POST['nombre'];
$telefono = $_POST['telefono'];
$email = $_POST['email'];
$mensaje = $_POST['mensaje'];

$thank="gracias.html";

$message = "
nombre:".$nombre."
telefono:".$telefono."
email:".$email."
mensaje:".$mensaje."";

if (mail($mail,"Formulario de Consulta",$message))
Header ("Location: $thank");

?>


3) gracias.html (este se presenta despues de que le das enviar y da las gracias )


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>

<body>
<b>Gracias</b>
<p><b><h3>lo mas pronto le responderemos </h3></b></p>



<?php
echo '&nombre':
echo '$telefono';
echo '$email';
echo 'Mensaje';
?>
</body>
</html>

si tienes alguna duda mandame un privado y te ayudo
__________________
Enseña todo lo que sepas...
Aprende todo lo que puedas..