Jump to content

Web mail form problem with one field...


thrllkll

Recommended Posts

Hello,

 

The code below is in my contactform.php file which takes variables from a contact form built in flash on my website.  Three of my fields work correctly, but the phone field does not.  It is always displayed as blank in the resulting email.  I've tested the variable being sent from the swf on flash and the telephone variable is populated.  Can anyone see the error in this code regarding $phone? 

 

Thank you very much,

David

 

************************

<?php

 

$recipients = "[email protected]" . ",";

$subject = "Message from xxxxx.com";

 

// Grab the key from Flash to ensure security

$sendKey  = $_POST['key'];

 

// Only allow the page to send if Flash is the requester

if($sendKey == "email") {

// The following four variables are gathered from Flash

$name = $_POST['name'];

$email = $_POST['email'];

$phone = $_POST['phone'];

$message = $_POST['message'];

 

// Grab todays date

$date = date("F j, Y", time());

 

// This block is the actual message that is sent in the email

$email_info .= "Below is the visitors contact info and message.\n\n";

$email_info .= "Visitor's Info:\n";

$email_info .= "-----------------------------------------\n";

$email_info .= "Name:  " . $name . "\n";

$email_info .= "Email:  " . $email . "\n";

$email_info .= "Telephone:  " . $phone . "\n";

$email_info .= "Date Sent:  " . $date . "\n\n";

$email_info .= "Message\n";

$email_info .= "-----------------------------------------\n";

$email_info .= "" . $message . "\n";

 

$mailheaders = "From: [email protected] <> \n";

$mailheaders .= "Reply-To: " . $email . "\n\n";

 

if(mail($recipients, $subject, $email_info, $mailheaders)) {

// Print a success for Flash to know the email is being sent

print "&success=true";

}

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/57016-web-mail-form-problem-with-one-field/
Share on other sites

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.