Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP email from flash contact form is jibberish - HELP!!

Status
Not open for further replies.

staryeyes47

Technical User
Jul 31, 2007
1
AU
Hi,

I am creating a contact page for a my website and I am having a bit of trouble. I have created the form in flash, and am using a php file to send the email to myself. The form works OK, but when it deliver's it to my inbox, I am getting all of this jibberish with the email Example:



Name: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#242868" LETTERSPACING="0" KERNING="0">Test</FONT></P></TEXTFORMAT>
Phone: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#242868" LETTERSPACING="0" KERNING="0">111111111</FONT></P></TEXTFORMAT>
Email: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#242868" LETTERSPACING="0" KERNING="0">someone@something.com</FONT></P></TEXTFORMAT>
Message: <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#242868" LETTERSPACING="0" KERNING="0">this is a test</FONT></P></TEXTFORMAT>
_childCounter: 1
focus_mc: _level0.depthChild0

I was wondering if anyone knew a way that I could get it to send clean emails that I could read? My input boxes are named Name, Phone, Email and Message. The script I have used on my submit button is:

on (release) {
if (Name eq "" or Phone eq "" or Email eq "" or Message eq "") {
stop();
} else {
loadVariablesNum("form.php", 0, "POST");
gotoAndStop(191);
}
}

And the PHP file is:

<?php
if (count($_POST)>0) $response = $_POST;
else $response = $_GET;
$Name = $HTTP_POST_VARS['Name'];
$Phone = $HTTP_POST_VARS['Phone'];
$Email = $HTTP_POST_VARS['Email'];
$Enquiry = $HTTP_POST_VARS['Enquiry'];
foreach ($response as $key => $val)
{
$msg .= "$key: $val";
$msg .= "\r\n";
}
$msg = stripslashes($msg);
mail("myemail@myemail.com", "Website Enquiry", $msg);
?>

Any help would be great as this is driving me insane!!!
 
In Flash, are you retrieving the HTML value from the field or the actual text value? I know that there are two different properties like .value and .text on some fields.

 
You seem to be getting the HTML code rather than plain text, can your mail client interpret html code?

Your PHP seems mostly correct, other than having the extra $HTTP_POST_VARS. which you then do nothing with.

In any case it looks like flash is sending the html code along with the values.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top