thrllkll Posted June 25, 2007 Share Posted June 25, 2007 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 = "xxxx@xxxxx.com" . ","; $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: webmaster@xxxxx.com <> \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"; } } ?> Quote Link to comment Share on other sites More sharing options...
AndyB Posted June 25, 2007 Share Posted June 25, 2007 Can anyone see the error in this code regarding $phone? No. So there must be a problem with the variable name not matching the name used for the form field. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.