Comunidad de diseño web y desarrollo en internet online

[SOLUCIONADO] Pasar una variable HTML a Texto

Citar            
MensajeEscrito el 22 Nov 2006 02:59 pm
Hola forer@s !!

Pues eso, que intento hacer un formulario que envíe al correo con todos los datos pero al recibir el correo muestra las etiquetas HTML y eso no lo quiero, ¿Hay alguna manera de que solo sea TEXTO?

Gracias de antemano :cool:

Por Korku

38 de clabLevel



Genero:Masculino  



Ultima edición por Korku el 22 Nov 2006 06:06 pm, editado 1 vez

msie
Citar            
MensajeEscrito el 22 Nov 2006 03:03 pm
deberas dar mas datos. que formulario estas usando?? con que codigos?

Por Mariux

BOFH

7756 de clabLevel

28 tutoriales
15 articulos

Genero:Femenino   Héroes Editores

Diseñadora & ilustradora

firefox
Citar            
MensajeEscrito el 22 Nov 2006 03:44 pm
Ok, no hay problema...

Es un formulario que consta de 5 labels (introdución de texto) y dos botones, uno para enviar y otro para resetar las labels...

Bien el código es el siguiente:

Para enviar:

Código :

on (release) {

   var tmp = new LoadVars();
   
   tmp.recipient = "[email protected]";
   tmp.subject = "Formulario de contacto desde prueba.es";
   tmp.redirect = "http://www.prueba.es";
   tmp.realname = "Contacto";

   tmp.Nombre = _parent.t1_2;
   tmp.Empresa = _parent.t2_2;
   tmp.Telefono = _parent.t3_2;
   tmp.Email = _parent.t4_2;
   tmp.Mensaje = _parent.t5_2;

   tmp.send("http://cgi.prueba.es/FormMail.pl", "", "POST");
   
   status = "Enviado correctamente...";
}


En el fotograma:

Código :


label_01 = _root.contacts_txt5;
label_02 = _root.contacts_txt6;
label_03 = _root.contacts_txt7;
label_04 = _root.contacts_txt8;
label_05 = _root.contacts_txt9;
t1_2 = label_01;
t2_2 = label_02;
t3_2 = label_03;
t4_2 = label_04;
t5_2 = label_05;
t1.onSetFocus = function() {
   if (t1_2 == label_01) {
      t1_2 = "";
   }
};
t2.onSetFocus = function() {
   if (t2_2 == label_02) {
      t2_2 = "";
   }
};
t3.onSetFocus = function() {
   if (t3_2 == label_03) {
      t3_2 = "";
   }
};
t4.onSetFocus = function() {
   if (t4_2 == label_04) {
      t4_2 = "";
   }
};
t5.onSetFocus = function() {
   if (t5_2 == label_05) {
      t5_2 = "";
   }
};
t1.onKillFocus = function() {
   if (t1_2 == "") {
      t1_2 = label_01;
   }
};
t2.onKillFocus = function() {
   if (t2_2 == "") {
      t2_2 = label_02;
   }
};
t3.onKillFocus = function() {
   if (t3_2 == "") {
      t3_2 = label_03;
   }
};
t4.onKillFocus = function() {
   if (t4_2 == "") {
      t4_2 = label_04;
   }
};
t5.onKillFocus = function() {
   if (t5_2 == "") {
      t5_2 = label_05;
   }
};



Recibe los valores predeterminados de un fichero de texto...

Al recibir el correo, me muestra esto:

Código :


Mensaje: <P ALIGN="LEFT"><FONT FACE="Tahoma" SIZE="11" COLOR="#7F7F7F" LETTERSPACING="0" KERNING="0">dasdasd</FONT></P>

Email: <P ALIGN="LEFT"><FONT FACE="Tahoma" SIZE="11" COLOR="#7F7F7F" LETTERSPACING="0" KERNING="0">asdas</FONT></P>

Telefono: <P ALIGN="LEFT"><FONT FACE="Tahoma" SIZE="11" COLOR="#7F7F7F" LETTERSPACING="0" KERNING="0">dasdsad</FONT></P>

Empresa: <P ALIGN="LEFT"><FONT FACE="Tahoma" SIZE="11" COLOR="#7F7F7F" LETTERSPACING="0" KERNING="0">asdsa</FONT></P>

Nombre: <P ALIGN="LEFT"><FONT FACE="Tahoma" SIZE="11" COLOR="#7F7F7F" LETTERSPACING="0" KERNING="0">asdasd</FONT></P>



Bien, esta plantilla está preparada para enviar desde PHP y ASP pero sin embargo el alojamiento web no tiene ambos soportes sino CGI/Perl

Saludos

Por Korku

38 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 22 Nov 2006 05:42 pm
Nadie lo sabe? :(

Por Korku

38 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 22 Nov 2006 06:05 pm
Conseguido

Solución:

En vez de :

Código :

tmp.Nombre = _parent.t1_2;
tmp.Empresa = _parent.t2_2;
tmp.Telefono = _parent.t3_2;
tmp.Email = _parent.t4_2;
tmp.Mensaje = _parent.t5_2;


Cambiar por:

Código :

tmp.Nombre = _parent.t1.text;
tmp.Empresa = _parent.t2.text;
tmp.Telefono = _parent.t3.text;
tmp.Email = _parent.t4.text;
tmp.Mensaje = _parent.t5.text;


Saludos :cool:

Por Korku

38 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 16 Abr 2011 04:05 pm
Hola! Yo tengo un problema similar: al enviar el formulario llega correctamente pero con las etiquetas html

Nombre: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"HelveticaNeueLT Std\" SIZE=\"13\" COLOR=\"#CC6600\" LETTERSPACING=\"0\" KERNING=\"0\">agui</FONT></P></TEXTFORMAT> Teléfono: <p align=\"left\"></p> Email: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"HelveticaNeueLT Std\" SIZE=\"13\" COLOR=\"#CC6600\" LETTERSPACING=\"0\" KERNING=\"0\">[email protected]</FONT></P></TEXTFORMAT> Mensaje: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"HelveticaNeueLT Std\" SIZE=\"13\" COLOR=\"#CC6600\" LETTERSPACING=\"0\" KERNING=\"0\">preuba</FONT></P></TEXTFORMAT>

Ya me probé activando/desactivando la opción <> (generar texto como html) como sugerían en algunos posts pero es indistinto, sigue llegando igual.
Tambien probe modificando algunasvariables del php pero no habia ningun cambio. Ya no se que mas tratar. Lei todos los temas que hablaban de esto pero no logre solucionar mi problema.
Alguien me puede ayudar???

El codigo en el flash es el siguiente.
Primer frame:

Código ActionScript :

miTexto.html = false;

send_button.onRelease = submit;
reset_button.onRelease = reset;
function submit()
{
   if( contact_name.text == "" || contact_email.text == "" || contact_message.text == "")
   {
      message_status.text = "Hay campos obligatorios sin rellenar.";
   }
   else if( contact_email.text.indexOf('@') < 2 || contact_email.text.indexOf('.') < 0 )
   {
      message_status.text = "Ingrese una dirección de correo electrónico válida";
   }
   else if( contact_message.text == "")
   {
      message_status.text = "Sus comentarios son importantes";
   }
   else
   {
      message_status.text = "";
      gotoAndStop("send");
   }
}
function reset()
{
   contact_name.text = contact_email.text = contact_telephone.text = 
   contact_message.text = message_status.text = "";
   clearInterval(interval_id);
   gotoAndStop("stop");
}


Frame 5

Código ActionScript :

stop();


Frame 11

Código ActionScript :

stop();
loadVariables("send_email.php?flashmo=" + random(1000), this, "POST");
message_status.text = "Enviando...";
var i = 0;
function check_status()
{
   if( success == "yes" )
   {
      message_status.text = "Su mensaje ha sido enviado con éxito";
      play();
   }
   else if( success == "no" )
   {
      message_status.text = "Su mensaje no pudo ser enviado. Intente otra vez.";
      gotoAndStop("stop");;
   }
   if( i >= 20 )
      clearInterval(interval_id);
   i++;
}
var interval_id = setInterval(check_status, 400);


Frame 70

Código ActionScript :

reset();
gotoAndStop("stop");
clearInterval(interval_id);


Y tengo dos botones uno con nomre de instancia reset_button y el otro send_button

Por ultimo este es el codigo PHP

Código PHP :

<?php
$contact_name = $_POST['name'];
$contact_email = $_POST['email'];
$contact_telephone = $_POST['telephone'];
$contact_message = $_POST['message'];

if( $contact_name == true )
{
   $sender = $contact_email;
   $receiver = "[email protected]";
   $client_ip = $_SERVER['REMOTE_ADDR'];
   $email_body = "Nombre: $contact_name 
   Teléfono: $contact_telephone 
   Email: $sender 
   Mensaje: $contact_message
   IP: $client_ip";
         
   
   if( mail( $receiver, "Contacto desde web Luis Torralva - $subject", $email_body ) ) 
   {
      echo "success=yes";
   }
   else
   {
      echo "success=no";
   }
}
?>

Por ERICASOSA

10 de clabLevel



 

msie8

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.