Ver Mensaje Individual
  #16 (permalink)  
Antiguo 13/09/2009, 00:47
p18640
 
Fecha de Ingreso: febrero-2004
Ubicación: Padul - Granada - España
Mensajes: 13
Antigüedad: 20 años, 2 meses
Puntos: 0
Respuesta: Necesito ayuda con un formulario

OK codig0:

Aquí te dejo los dos códigos`para que no tengas que andar buscando uno u otro.

Este es el del formulario que rellena el cliente, se llama (form_enviar.php):

<html>
<head>
<title>Enviar reservas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
if (!$_POST){
?>
<form name="form_enviar" form action="form_recibir.php" method="post">
<table width="400" border="0" align="center" cellpadding="2" cellspacing="3" summary="Formulario de Reservas">
<tr>
<th scope="row">Nombre:</th>
<td><input type="text" id="nombre" name="nombre" size="45" /></td>
</tr>
<tr>
<th scope="row">Tel&eacute;fono:</th>
<td><input type="text" id="telefono" name="telefono" size="12" /></td>
</tr>
<tr>
<th scope="row">E-mail:</th>
<td><input type="text" id="email" name="email" size="45" /></td>
</tr>
<tr>
<th scope="row">Fecha:</th>
<td><input type="text" id="fecha" name="fecha" size="8" /></td>
</tr>
<tr>
<th scope="row">Hora:</th>
<td><input type="text" id="hora" name="hora" size="5" /></td>
</tr>
<tr>
<th scope="row">Comensales:</th>
<td><input type="text" id="comensales" name="comensales" size="3" /></td>
</tr>
<tr>
<th rowspan="2" valign="top" scope="row"><strong>Comentarios: </strong>
<td><textarea name="comentarios" id="comentarios" cols="40" rows="10"></textarea></td>
</tr>
<tr>
<td> <div align="center">
<input name="bot&oacute;n" type="submit" value="Enviar" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="reset" type="reset" value="Borrar" />
</div></td>
</tr>
</table>
<div align="center"></div>
</form>
<?php
}else{

echo "Ha ocurrido un error";
}

?>



</body>
</html>


Este es el que envía el correo a mi cuenta y debería mostrar al cliente una pantalla con los datos con los que se ha enviado el correo (se llama form_recibir.php):

<html>
<head>
<title>Recibir reservas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#B8B198" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><br>
<br>
<table width="400" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#EEEEE3">
<tr bgcolor="#FF9900">
<td colspan="2"> <div align="center"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>Su
solicitud se ha enviado con la siguiente informaci&oacute;n</strong>
</font></div></td>
</tr>
<tr>
<td width="26%" height="132" bgcolor="#990000">&nbsp;</td>
<td width="74%" align="left" valign="middle"><strong><font size="2" face="Arial, Helvetica, sans-serif">Nombre:
</font></strong> <font size="2" face="Arial, Helvetica, sans-serif"><?php echo $nombre;?><br/>
<strong>Teléfono: </strong> <?php echo $telefono;?><br/>
<strong>E-mail: </strong> <?php echo $email;?><br/>
<strong>Fecha: </strong> <?php echo $fecha;?><br/>
<strong>Hora: </strong> <?php echo $hora;?> <br/>
<strong>Comensales: </strong> <?php echo $comensales;?> <br/>
<strong>Comentarios:</strong> <?php echo $comentarios;?> </p>&nbsp;</font></td>
</tr>
<tr>
<td height="36" bgcolor="#990000">&nbsp;</td>
<td align="left" valign="middle"><div align="right"><a href="midominio"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Volver</font></a></div></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
if ($_POST){

$nombre = $_POST["Nombre"];
$telefono = $_POST["Teléfono"];
$email = $_POST["E-mail"];
$fecha = $_POST["Fecha"];
$hora = $_POST["Hora"];
$comensales = $_POST["Comensales"];
$comentarios = $_POST["Comentarios"]; ?>


<?php

$cuerpo .="Nombre: ".$_POST["nombre"]."
"."<br />";
$cuerpo .="Teléfono: ".$_POST["telefono"]."
"."<br />";
$cuerpo .="E-mail: ".$_POST["email"]."
"."<br />";
$cuerpo .="Fecha: ".$_POST["fecha"]."
"."<br />";
$cuerpo .="Hora: ".$_POST["hora"]."
"."<br />";
$cuerpo .="Comensales: ".$_POST["comensales"]."
"."<br />";
$cuerpo .="Comentarios: ".$_POST["comentarios"]."
"."<br />";

$headers="MIME-Version: 1.0
";
$headers.= "Content-type: text/html; charset=iso-8859-1
";

mail("micorreo.com","Solicitud de reserva",$cuerpo,$headers);
}else{
echo "Su solicitud no ha podido ser enviada";
}
?>
</body>
</html>


Gracias