Jump to content

FLASH WITH PHP EMAIL FORM PROBLEM


nightkarnation

Recommended Posts

Hello...Here's the comple PHP code: and commented the line that has a problem

 

Everything works fine but when i try to email with mail() i get the following error on FLASH:

 

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.

 

if ($action == "uploadContact")
{

$name=$_POST['txtName'];
$email=$_POST['email'];
$message=$_POST['txtMessage'];
$date = date("F j, Y");
$time = time();

$to = "[email protected]";			 
$subject = "Contact from my site";
$headers = "From: " . $email;
mail($to,$subject,$message,$headers); //THIS LINE IF I REMOVE IT...
//EVERYTHING WORKS FINE AND NO ERROR IS DISPLAYED ON FLASH
//ONLY OBVIOUSLY THAT THE EMAIL IS NOT SENT

$result = mysql_query("INSERT INTO `contact` (name, email, message, date, time) VALUES ('$name', '$email', '$message', '$date', '$time')");
if($result) { 
$imdoneUpdate = true;
echo "imdoneUpdate=".$imdoneUpdate;
} else { 
$imdoneUpdate = false;
echo "imdoneUpdate=".$imdoneUpdate;
}

}

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/146724-flash-with-php-email-form-problem/
Share on other sites

Try This:

$name = $_POST['txtName'];
$email = $_POST['email'];
$body = $_POST['txtMessage'];
$date = date("F j, Y");
$time = time();

$to = "[email protected]";
$subject = "Contact From Your Site!";
$headers = 'From: ' . $email;
if (mail($to, $subject, $body, $headers)) {
  echo("<p>Message successfully sent!</p>");
} else {
  echo("<p>Message delivery failed...</p>");
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.