Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2008, 15:25
mactintosh
 
Fecha de Ingreso: mayo-2007
Mensajes: 73
Antigüedad: 16 años, 10 meses
Puntos: 0
Problema con formulario dentro de flash utilizando php para el envio

Hola a todos...
Tengo un problema con formulario dentro de una web hecha en flash que utiliza un archivo php para enviar el email.

He modificado los codigos del main y el boton submit del formulario dentro del flash. Cuando desde la web se rellena el formulario y se pincha el boton submit accede al archivo php para enviar el email y se me habre la ventana de confirmacion del envio, pero no lo envia y en la ventana ademas del mensaje de confirmacion se visualiza parte del codigo PHP.

Me podriais echar una mano con los codigos ?
No creo que los codigos del flash esten mal (¿aunque puede ser que halla algun codigo para el que deba crear otro Action Layer?), creo que puede ser el archivo PHP.
Pero tengo el mismo archivo con los mismos codigos funcionando en otra web y si van correctamente y envia los emails. Por eso me extraña que en esta web no funcionen.

Aqui dejo los codigos del main del formulario en flash, del boton submit y del archivo PHP.

//Codigo Action Layer del main del formulario en flash


rec = "[email protected]";
serv = "php";
var fields_descriptions = Array("", Array("t1", "your_name", "Your Name:"), Array("t2", "your_phone", "Your Phone:"), Array("t4", "your_fax", "Your Fax:"), Array("t5", "your_email", "Your Email:"), Array("t6", "message", "message:"));
for (i = 1; i <= fields_descriptions.length; i++)
{
this["k" + i].text = fields_descriptions[i][2];
} // end of for


t1.onSetFocus = function ()
{
if (t1.text == "Your Name:")
{
t1.text = "";
} // end if
};
t1.onKillFocus = function ()
{
if (t1.text == "")
{
t1.text = "Your Name:";
} // end if
};
t2.onSetFocus = function ()
{
if (t2.text == "Your Phone:")
{
t2.text = "";
} // end if
};
t2.onKillFocus = function ()
{
if (t2.text == "")
{
t2.text = "Your Phone:";
} // end if
};
t3.onSetFocus = function ()
{
if (t3.text == "Your Fax:")
{
t3.text = "";
} // end if
};
t3.onKillFocus = function ()
{
if (t3.text == "")
{
t3.text = "Your Fax:";
} // end if
};
t4.onSetFocus = function ()
{
if (t4.text == "Your Email:")
{
t4.text = "";
} // end if
};
t4.onKillFocus = function ()
{
if (t4.text == "")
{
t4.text = "Your Email:";
} // end if
};
t5.onSetFocus = function ()
{
if (t5.text == "Message:")
{
t5.text = "";
} // end if
};
t5.onKillFocus = function ()
{
if (t5.text == "")
{
t5.text = "Message:";
} // end if
};



//Codigo del boton submit de la web en flash


on (rollOver) {
gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
gotoAndPlay("s2");
}

on (release) {
for (i=1; i<_parent.fields_descriptions.length; i++) {
if (_parent[_parent.fields_descriptions[i][1]]!=undefined) {
this[_parent.fields_descriptions[i][1]]=_parent[_parent.fields_descriptions[i][1]]+"&777&"+_parent.fields_descriptions[i][2];
}

}

this.recipient=_parent.rec;
i=undefined;
getURL("contact."+_parent.serv, "_blank", "POST");

}




//Codigo del archivo PHP para el envio del email


<?
Error_Reporting(E_ALL & ~E_NOTICE);

while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=$pre_array[0];
$post_vars[key($_REQUEST)][1]=$pre_array[1];
}
next($_REQUEST);
}



reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

$message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
}
next($post_vars);
}

mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Tu mensaje a sido enviado satisfactoriamente!");

?>
<script>
resizeTo(300, 300);
</script>


Espero me podais ayudar ya que este formulario es importante.
Muchas gracias a todos y un saludo.