Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Contact form using Flash and PHP


  • Please log in to reply

#1
Diego8

Diego8

    Member

  • Member
  • PipPipPip
  • 189 posts
Hello.
I'm developing a Flash 9 based website with a contact form which uses a php script to send an e-mail with the filled data.
In flash i'm using the loadVariablesNum function to send the data to the php script.

The mail is recivied but the message also contains HTML tags.
This is an example.

Sender (as shown in inbox):
<TEXTFORMAT LEADING=2><P ALIGN=LEFT><FONT FACE=Verdana SIZE=10 COLOR=#8D2222 LETTERSPACING=0 KERNING=0>test sender</FONT></P></TEXTFORMAT><<TEXTFORMAT LEADING=2><P ALIGN=LEFT><FONT FACE=Verdana SIZE=10 COLOR=#8D2222 LETTERSPACING=0 </FONT></P></TEXTFORMAT>> <KERNING=\"0\"[email protected]>

Message body:

Name: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#8D2222\" LETTERSPACING=\"0\" KERNING=\"0\">test sender</FONT></P></TEXTFORMAT> Dirección : <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#8D2222\" LETTERSPACING=\"0\" KERNING=\"0\">ajdhah</FONT></P></TEXTFORMAT> Teléfono : <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#8D2222\" LETTERSPACING=\"0\" KERNING=\"0\">adjaj</FONT></P></TEXTFORMAT> E-mail : <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#8D2222\" LETTERSPACING=\"0\" KERNING=\"0\">[email protected]</FONT></P></TEXTFORMAT> Mensaje: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#8D2222\" LETTERSPACING=\"0\" KERNING=\"0\">ajsdasjhjas</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#8D2222\" LETTERSPACING=\"0\" KERNING=\"0\">asdhaj</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#8D2222\" LETTERSPACING=\"0\" KERNING=\"0\">adajsdsjh</FONT></P></TEXTFORMAT>

Is there any way to prevent flash from sending those html tags?.

Any help is greatly appreciated.
Thanks.
  • 0

Advertisements


#2
Diego8

Diego8

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 189 posts
Hi.
Just to let all know, last friday i could solve the issue. In fact, i had to recode the whoe actionscript involved in the variable passing to php.
I had to do something like this:

var sendData:LoadVars = new LoadVars(); //i believe this behaves like a seudo-collection.
var recieveData:LoadVars = new LoadVars();
			
sendData.textname = textnombre.text;
sendData.direccion = textdir.text;
sendData.texttel = texttel.text;
sendData.textmail = textmail.text;
envsendData.textmens = textmens.text;
sendData.sendAndLoad("./common/scripts/sendmail.php",recieveData,"POST");

Using that PHP recives only the text entered in the text fields without those annoyings html tags.
Don't know why the LoadVariablesNum has that behaviour because lots of tutorials about actionscripts contact forms use it... who knows...
At least the other way worked fine.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP