Search the Community
Showing results for tags 'web site mail code'.
-
Dear readers and coders, I have to recognize I do not have any idea on coding, but not having enought fund to hire a coder I have to do it myself, but some time I cannot solve the issue, and that is the reason I am posting this topic. I need a Html form trasmiting to a PHP code all fields and this last sending it to my email account. For that I got a free basic code and try to modify to my need but without success. The script give an error when all fields are listed in the mail (?) working fine just with the original field "$Comments". Can any of you tell me the problem or get this script to work. I award with 10 USD paid by paypal to the first put this code to work properly. ###### Script ############# <?php $to = "acmoreu@terra.es"; ini_set("SMTP","localhost"); $quotation_page = "quotation_form.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html"; $company = $_REQUEST['company'] ; $name = $_REQUEST['name'] ; $phone = $_REQUEST['phone'] ; $email_address = $_REQUEST['email_address'] ; $products = $_REQUEST['products'] ; $items = $_REQUEST['items'] ; $area = $_REQUEST['area'] ; $date = $_REQUEST['date'] ; $address = $_REQUEST['address'] ; $city = $_REQUEST['city'] ; $province = $_REQUEST['province'] ; $country = $_REQUEST['country'] ; $comments = $_REQUEST['comments'] ; function isInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } // If the user tries to access this script directly, redirect them to the quotation form, if (!isset($_REQUEST['email_address'])) { header( "Location: $quotation_page" ); } // If the form fields are empty, redirect to the error page. elseif (empty($email_address) || empty($comments)) { header( "Location: $error_page" ); } // If email injection is detected, redirect to the error page. elseif ( isInjected($email_address) ) { header( "Location: $error_page" ); } // If we passed all previous tests, send the email then redirect to the thank you page. else { mail( "$to", "Quotation Request - Flexypatch", "$company", "$name", "$phone", $products, $items, $area, $date, $address, $city, $province, $country, $comments, "From: $email_address" ); header( "Location: $thankyou_page" ); } ?> ############# Errors ################### Warning: mail() expects at most 5 parameters, 15 given in D:\hshome\klassmar\flexypatch.com\Quotation\send_mail.php on line 59 Warning: Cannot modify header information - headers already sent by (output started at D:\hshome\klassmar\flexypatch.com\Quotation\send_mail.php:59) in D:\hshome\klassmar\flexypatch.com\Quotation\send_mail.php on line 60 I can provide the html pages code of the filling form, if need. Thanks! error_message.html quotation_form.html send_mail.php thank_you.html