kkll70 Posted July 1, 2008 Share Posted July 1, 2008 I got a form on a website and when you fill it out you click send and it's suppose to send it to my email but it gives me error 'undefined'. Feedback.php : <?php $to = '[email protected]'; $subject = 'Contact Form from Site'; $message = 'From: '.$_POST['from']."\n\n"; $message .= 'Subject: '.$_POST['subject']."\n\n"; $message .= 'Company: '.$_POST['company']."\n\n"; $message .= 'Phone: '.$_POST['phone']."\n\n"; $message .= 'Fax: '.$_POST['fax']."\n\n"; $message .= 'Address: '.$_POST['address']."\n\n"; $message .= 'City: '.$_POST['city']."\n\n"; $message .= 'State: '.$_POST['state']."\n\n"; $message .= 'Zip: '.$_POST['zip']."\n\n"; $message .= 'Email: '.$_POST['email']."\n\n"; $message .= 'Comments: '.$_POST['comments']."\n\n"; $additionalHeaders = "From: Feedback<[email protected]>\n"; $additionalHeaders .= "Reply-To: $_POST[email]"; $OK = mail($to, $subject, $message, $additionalHeaders); if ($OK) { echo 'sent=OK'; } else { echo 'sent=failed&reason='. urlencode('Theres seems to be a problem with the server. Please try later.')} ?> My flash code : function checkForm() :Boolean { var missing:Boolean = false; errorName_txt.text = errorCompany_txt.text = errorPhone_txt.text = errorFax_txt.text = errorAddress_txt.text = errorCity_txt.text = errorState_txt.text = errorZip_txt.text = errorSubject_txt.text = errorEmail_txt.text=errorComments_txt.text=""; if (name_txt.text == ""){ errorName_txt.text = "*"; missing = true; } if (company_txt.text == ""){ errorCompany_txt.text = "*"; missing = true; } if (phone_txt.text == ""){ errorPhone_txt.text = "*"; missing = true; } if (fax_txt.text == ""){ errorFax_txt.text = "*"; missing = true; } if (email_txt.text.indexOf("@") == -1) { errorEmail_txt.text = "*"; missing = true; } if (address_txt.text == "") { errorAddress_txt.text = "*"; missing = true; } if (city_txt.text == "") { errorCity_txt.text = "*"; missing = true; } if (state_txt.text == "") { errorState_txt.text = "*"; missing = true; } if (zip_txt.text == "") { errorState_txt.text = "*"; missing = true; } if (subject_txt.text == "") { errorSubject_txt.text = "*"; missing = true; } if (comments_txt.text == "") { errorComments_txt.text = "*"; missing = true; } return missing ? false : true; } function sendMessage():Void { var formOK:Boolean = checkForm(); if (formOK) { message.from = name_txt.text; message.subject = subject_txt.text message.company = company_txt.text; message.phone = phone_txt.text; message.fax = fax_txt.text; message.email = email_txt.text; message.address = address_txt.text; message.city = city_txt.text; message.state = state_txt.text; message.zip = zip_txt.text message.comments = comments_txt.text; message.sendAndLoad("feedback.php?ck="+ new Date().getTime(), messageSent); gotoAndStop("send"); } } function backToForm():Void { gotoAndStop("Form"); } var dateDisplay:TextFormat = new TextFormat(); dateDisplay.font = "Georgia,Times,_serif"; theDate_txt.setNewTextFormat(dateDisplay); theDate_txt.autoSize = "left"; var getDate:LoadVars = new LoadVars(); var message:LoadVars = new LoadVars(); var messageSent:LoadVars = new LoadVars(); getDate.load("today2.php"); getDate.onLoad= function() { theDate_txt.text = this.theDate; }; messageSent.onLoad = function() { if (this.sent == "OK") { gotoAndStop("confirmed"); } else { gotoAndStop("failed"); failure_txt.text = this.reason; } }; gotoAndStop("Form"); Link to comment https://forums.phpfreaks.com/topic/112836-help-please-contact-code-php-flash-dont-work/ Share on other sites More sharing options...
MatthewJ Posted July 1, 2008 Share Posted July 1, 2008 <?php $to = '[email protected]'; $subject = 'Contact Form from Site'; $message = 'From: '.$_POST['from']."\n\n"; $message .= 'Subject: '.$_POST['subject']."\n\n"; $message .= 'Company: '.$_POST['company']."\n\n"; $message .= 'Phone: '.$_POST['phone']."\n\n"; $message .= 'Fax: '.$_POST['fax']."\n\n"; $message .= 'Address: '.$_POST['address']."\n\n"; $message .= 'City: '.$_POST['city']."\n\n"; $message .= 'State: '.$_POST['state']."\n\n"; $message .= 'Zip: '.$_POST['zip']."\n\n"; $message .= 'Email: '.$_POST['email']."\n\n"; $message .= 'Comments: '.$_POST['comments']."\n\n"; $additionalHeaders = "From: Feedback<[email protected]>\n"; $additionalHeaders .= "Reply-To: $_POST[email]"; $OK = mail($to, $subject, $message, $additionalHeaders); if ($OK) { echo 'sent=OK'; } else { echo 'sent=failed&reason='. urlencode('Theres seems to be a problem with the server. Please try later.)} ?> You were missing a single quote after your email address... At least that was the first thing I saw Link to comment https://forums.phpfreaks.com/topic/112836-help-please-contact-code-php-flash-dont-work/#findComment-579544 Share on other sites More sharing options...
DarkWater Posted July 1, 2008 Share Posted July 1, 2008 I'm 100% sure he changed the e-mail address for when he posted it and just forgot that '. Link to comment https://forums.phpfreaks.com/topic/112836-help-please-contact-code-php-flash-dont-work/#findComment-579545 Share on other sites More sharing options...
kkll70 Posted July 1, 2008 Author Share Posted July 1, 2008 lol yeah dark water is right Link to comment https://forums.phpfreaks.com/topic/112836-help-please-contact-code-php-flash-dont-work/#findComment-579547 Share on other sites More sharing options...
MatthewJ Posted July 1, 2008 Share Posted July 1, 2008 I've only been 100% sure of a few things in my life... but I'll give you credit for that kind of confidence. I just assume nothing Link to comment https://forums.phpfreaks.com/topic/112836-help-please-contact-code-php-flash-dont-work/#findComment-579556 Share on other sites More sharing options...
kkll70 Posted July 1, 2008 Author Share Posted July 1, 2008 So no one knows whats that problem? Link to comment https://forums.phpfreaks.com/topic/112836-help-please-contact-code-php-flash-dont-work/#findComment-579588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.