Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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\"dd@i.com>

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\">dd@i.com</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