Pasar datos de un formulario a otro.
Publicado por pixel2you (6 intervenciones) el 09/04/2006 06:22:32
Buenas gente, me gustaría saber si me podeis ayudar con lo siguiente:
Tengo dos formularios, cada uno en una web diferente, uno contiene los datos, y cuando se completa, redirecciona al otro, que es de validación, bien pues me gustaría saber que tengo que hacer para llevarme los datos del primero formulario al segundo, para que sean enviados correctamente al mail.
En el .php, del primero formulario tengo lo siguiente:
<?
session_start();
$destinatario="[email protected]";
$fecha = date("d-M-y H:i");
$de=$_POST['email'];
if ($_SERVER["HTTP_X_FORWARDED_FOR"] != "")
$ip.=$_SERVER["HTTP_X_FORWARDED_FOR"] . "\nIP Proxy: " . $_SERVER["REMOTE_ADDR"];
else
$ip.=$_SERVER["REMOTE_ADDR"];
$asunto="Formulario de contacto";
$cabeceras.= "MIME-Version: 1.0\r\n";
$cabeceras.= "Content-type: text/html; charset=iso-8859-1\r\n";
$cabeceras.= "From: {$_POST['nombre']} {$_POST['apellidos']}<{$de}>\r\n";
$cabeceras.= "Last-Modified: ".$fecha." GMT\r\n";
$cabeceras.= "Cache-Control: no-cache, must-revalidate\r\n";
$cabeceras.= "Pragma: no-cache\r\n";
$cabeceras.= "Reply-To: {$de}\r\n";
$cabeceras.= "CC:[email protected]\r\n";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: Servicio de contacto pixel2you <{$destinatario}>\r\n";
$headers.= "Last-Modified: ".$fecha." GMT\r\n";
$headers.= "Cache-Control: no-cache, must-revalidate\r\n";
$headers.= "Pragma: no-cache\r\n";
$headers.= "Reply-To: {$destinatario}\r\n";
$respuesta='<html><head><link href="http://www.pixel2you.com/estilos.css" rel="stylesheet" type="text/css"></head>
<body>
<div align="center">
<table width="421" height="288" border="0" cellpadding="0" cellspacing="0" class="tabla">
<tr><hr/>
<td width="20" height="187" align="left" valign="middle"></td>
<td align="left" valign="middle"><div align="justify"><span class="textos">Gracias por contactar con <a href="http://www.pixel2you.com/" class="links">pixel2you</a>. Pronto nos pondremos en contacto con usted.
<br/>
<br/>
Atentamente<br/> <em>Servicio de contacto pixel2you</em>
</span></div></td>
<td width="20" align="left" valign="middle"></td>
</tr>
<tr align="left" valign="middle">
<td height="25" colspan="3" valign="middle"><img src="http://www.pixel2you.com/Images/fondocondiciones.gif" width="422" height="32"><hr/></td>
</tr>
</table>
</div>
</body>
</html>';
$texto='<html><head><link href="http://www.pixel2you.com/estilos.css" rel="stylesheet" type="text/css"></head>
<body>
<div align="center">
<table width="421" height="288" border="0" cellpadding="0" cellspacing="0" class="tabla">
<tr><hr/>
<td width="20" height="187" align="left" valign="middle"></td>
<td align="left" valign="middle"><div align="justify"><span class="textos">Has recibido un mail de <strong>'.$_POST['nombre'].' '.$_POST['apellidos'].' ('.$_POST['empresa'].')</strong>, el '.$fecha.', con el siguiente contenido:<br /><br/><em> '.$_POST['comentario'].'</em>
<br/>
<br/>
<strong><u>Información del usuario:</u></strong><br/> Nombre: '.$_POST['nombre'].' '.$_POST['apellidos'].' <br/> Empresa: '.$_POST['empresa'].' <br/> E-mail: '.$de.' <br/> Ip: '.$ip.'
</span></div></td>
<td width="20" align="left" valign="middle"></td>
</tr>
<tr align="left" valign="middle">
<td height="25" colspan="3" valign="middle"><img src="http://www.pixel2you.com/Images/fondocondiciones.gif" width="422" height="32"><hr/></td>
</tr>
</table>
</div>
</body>
</html>';
?>
Mientras que en el .php del formulario de confirmacion tengo lo siguiente:
<?
session_start();
if($_SESSION['codigo']!=$_POST['codigo_seguridad'])
{
header('Location: http://www.pixel2you.com/fallo.html');
}
else
{
if(mail($destinatario, $asunto, $texto,$cabeceras))
{
header('Location: http://www.pixel2you.com/completado.html');
mail($de, $asunto, $respuesta,$headers);
}
else {
header('Location: http://www.pixel2you.com/fallo.html');
}
}
?>
Que tendria que poner en este segundo o en el primero formulario, para que todo lo del primero, se almacene en el segundo .php?, para despues poderlo enviar?
Muchas gracias.
Tengo dos formularios, cada uno en una web diferente, uno contiene los datos, y cuando se completa, redirecciona al otro, que es de validación, bien pues me gustaría saber que tengo que hacer para llevarme los datos del primero formulario al segundo, para que sean enviados correctamente al mail.
En el .php, del primero formulario tengo lo siguiente:
<?
session_start();
$destinatario="[email protected]";
$fecha = date("d-M-y H:i");
$de=$_POST['email'];
if ($_SERVER["HTTP_X_FORWARDED_FOR"] != "")
$ip.=$_SERVER["HTTP_X_FORWARDED_FOR"] . "\nIP Proxy: " . $_SERVER["REMOTE_ADDR"];
else
$ip.=$_SERVER["REMOTE_ADDR"];
$asunto="Formulario de contacto";
$cabeceras.= "MIME-Version: 1.0\r\n";
$cabeceras.= "Content-type: text/html; charset=iso-8859-1\r\n";
$cabeceras.= "From: {$_POST['nombre']} {$_POST['apellidos']}<{$de}>\r\n";
$cabeceras.= "Last-Modified: ".$fecha." GMT\r\n";
$cabeceras.= "Cache-Control: no-cache, must-revalidate\r\n";
$cabeceras.= "Pragma: no-cache\r\n";
$cabeceras.= "Reply-To: {$de}\r\n";
$cabeceras.= "CC:[email protected]\r\n";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: Servicio de contacto pixel2you <{$destinatario}>\r\n";
$headers.= "Last-Modified: ".$fecha." GMT\r\n";
$headers.= "Cache-Control: no-cache, must-revalidate\r\n";
$headers.= "Pragma: no-cache\r\n";
$headers.= "Reply-To: {$destinatario}\r\n";
$respuesta='<html><head><link href="http://www.pixel2you.com/estilos.css" rel="stylesheet" type="text/css"></head>
<body>
<div align="center">
<table width="421" height="288" border="0" cellpadding="0" cellspacing="0" class="tabla">
<tr><hr/>
<td width="20" height="187" align="left" valign="middle"></td>
<td align="left" valign="middle"><div align="justify"><span class="textos">Gracias por contactar con <a href="http://www.pixel2you.com/" class="links">pixel2you</a>. Pronto nos pondremos en contacto con usted.
<br/>
<br/>
Atentamente<br/> <em>Servicio de contacto pixel2you</em>
</span></div></td>
<td width="20" align="left" valign="middle"></td>
</tr>
<tr align="left" valign="middle">
<td height="25" colspan="3" valign="middle"><img src="http://www.pixel2you.com/Images/fondocondiciones.gif" width="422" height="32"><hr/></td>
</tr>
</table>
</div>
</body>
</html>';
$texto='<html><head><link href="http://www.pixel2you.com/estilos.css" rel="stylesheet" type="text/css"></head>
<body>
<div align="center">
<table width="421" height="288" border="0" cellpadding="0" cellspacing="0" class="tabla">
<tr><hr/>
<td width="20" height="187" align="left" valign="middle"></td>
<td align="left" valign="middle"><div align="justify"><span class="textos">Has recibido un mail de <strong>'.$_POST['nombre'].' '.$_POST['apellidos'].' ('.$_POST['empresa'].')</strong>, el '.$fecha.', con el siguiente contenido:<br /><br/><em> '.$_POST['comentario'].'</em>
<br/>
<br/>
<strong><u>Información del usuario:</u></strong><br/> Nombre: '.$_POST['nombre'].' '.$_POST['apellidos'].' <br/> Empresa: '.$_POST['empresa'].' <br/> E-mail: '.$de.' <br/> Ip: '.$ip.'
</span></div></td>
<td width="20" align="left" valign="middle"></td>
</tr>
<tr align="left" valign="middle">
<td height="25" colspan="3" valign="middle"><img src="http://www.pixel2you.com/Images/fondocondiciones.gif" width="422" height="32"><hr/></td>
</tr>
</table>
</div>
</body>
</html>';
?>
Mientras que en el .php del formulario de confirmacion tengo lo siguiente:
<?
session_start();
if($_SESSION['codigo']!=$_POST['codigo_seguridad'])
{
header('Location: http://www.pixel2you.com/fallo.html');
}
else
{
if(mail($destinatario, $asunto, $texto,$cabeceras))
{
header('Location: http://www.pixel2you.com/completado.html');
mail($de, $asunto, $respuesta,$headers);
}
else {
header('Location: http://www.pixel2you.com/fallo.html');
}
}
?>
Que tendria que poner en este segundo o en el primero formulario, para que todo lo del primero, se almacene en el segundo .php?, para despues poderlo enviar?
Muchas gracias.
Valora esta pregunta


0