Ver Mensaje Individual
  #7 (permalink)  
Antiguo 22/12/2008, 13:40
olibra72
 
Fecha de Ingreso: diciembre-2008
Mensajes: 5
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: No recibo bien la respuesta de un formulario.

Hola de nuevo, aquí os muestro el código. Con PHP ando bastante perdido pero creo que he utilizado dos veces la instrucción "<?php"...


Este es el código del formulario:

<form action="formulario/encuesta_respuesta.php" method="post" name="encuesta" target="_blank" id="encuesta">
<select name="lista" id="lista">
<option>Internet (anuncio publicitario)</option>
<option>Internet (a trav&eacute;s de un buscador)</option>
<option>Folletos publicitarios</option>
<option>Prensa</option>
<option>Amigos</option>
<option>Otros</option>
</select>
<input type="submit" name="Submit" value="Enviar" />
</form>


Este es el código de la página de agradecimiento que utilizo para hacer el envío de los datos. La sección donde envío los datos la he marcado en rojo:


<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-transitional.dtd">
<html>
<head>
----Aquí van las etiquetas meta-------
<link rel="stylesheet" type="text/css" href="mail.css" />
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body background="../Imagenes/Etiquetas%20Y%20Fondos/FondoPantalla.gif" link="#0000FF" vlink="#0000FF" alink="#0000FF" onload="MM_preloadImages('../Imagenes/Simbolos/LogotipoEvosAzul.gif')">
<table width="311" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="107" height="42">&nbsp;</td>
<td width="198">&nbsp;</td>
<td width="6">&nbsp;</td>
</tr>
<tr>
<td rowspan="2" valign="top"><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('logo','','../Imagenes/Simbolos/LogotipoEvosAzul.gif',1)"><img src="../Imagenes/Simbolos/LogotipoEvos.gif" alt="Grupo Evos." name="logo" width="80" height="85" border="0" id="logo" /></a></td>
<td height="67" valign="top"><p><font color="#0000FF">Gracias por su Respuesta</font></p>
<p><font color="#0000FF">Thank you for your response</font></p></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="18" align="center" valign="middle">
<?php
$dia=date("d.m.Y");
$hora=date("H:i:s");
$destinatario="[email protected]";
$asunto="encuesta";
$para="Grupo Evos";
$contingut = "
El mensaje se a enviado el dia $dia a las $hora\n\n
----------------------------------------------------------------------------\n
Respuesta: $_POST[lista]\n
----------------------------------------------------------------------------\n
";
mail($destinatario, $asunto, $para, $contingut);
?>

</td>
<td></td>
</tr>
<tr>
<td height="5"></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="1" valign="top"><img src="transparent.gif" alt="" width="107" height="1"></td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
</table>
</body>
</html>

Gracias por la ayuda, un saludo.