Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6272
38458 credits Members referred : 374
It's time to use PHP5!
« Reply #8 on: Jun 21, 2006, 03:48:09 PM »
the code must look like:
Code:
<?php include("validation_class.php"); if (isset($_POST['submit'])) { $example = new Validate_fields; $example->check_4html = true; $example->add_text_field("Simple_text", $_POST['string'], "text", "y"); $example->add_num_field("Number", $_POST['number'], "number", "n", 0, 5); $example->add_num_field("Number_with_decimals", $_POST['decimal'], "decimal", "n", 2); $example->add_date_field("Euro_date", $_POST['date'], "date", "eu", "n"); $example->add_check_box("Check_box", "check", "checkbox"); $example->add_link_field("Email_address", $_POST['email'], "email"); $example->add_link_field("internet_link", $_POST['url'], "url", "n"); if ($example->validation()) { $goto_after_mail = "thanks.htm"; // this is the page which is shown after the mail is submitted $from_mail = $_REQUEST['from_email']; $from_name = $_REQUEST['from_name']; // use both value's from your form $header = "From: \"$from_name\" <$from_mail>\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: text/plain; charset=\"utf-8\"\r\n"; $header .= "Content-Transfer-Encoding: 7bit\r\n"; $subject = "Your webform posted at ".date("d-m-Y"); //your mailsubject incl. current date foreach ($_REQUEST as $key => $val) { if ($key != "from_email" && $key != "from_name") { //skip, this values are already in the header $body .= $key . " : " . $val . "\r\n"; } } if (mail("you@yourmail.com", $subject, $body, $header)) { header("Location: ".$goto_after_mail); } } else { $error = $example->create_msg(); } } ?> but there is more to do...but you know that right?