saleekr
September 1st, 2008, 07:13 PM
Hi, i just downloaded this form and after looking around tried to make my own tweaks, however i keep getting errors.
here is my code
<?php
if(isset($_POST['submit'])) {
$to = "email@email.com";
$subject = "contact";
$name_field = $_POST['posName'];
$title_field = $_POST['posTitle'];
$company_field = $_POST['posComp'];
$addy_field = $_POST['posAddy'];
$phone_field = $_POST['posPhone'];
$email_field = $_POST['posEmail'];
$web_field = $_POST['posWeb'];
$message = $_POST['message'];
$desc = $_POST['describe'];
$other = $_POST['other'];
$ctime = $_POST['posTime'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
foreach($_POST['contact'] as $value2) {
$check_msg2 .= "Checked: $value2\n";
}
$body = "From: $name_field\n Title: $title_field\n Comapny: $company_field\n Address: $addy_field\n Phone: $phone_field\n E-Mail: $email_field\n Website: $web_field\n Request Reason: $check_msg\n Answer for Do you have a carpet question: $desc\n Answer when client chose Other: $other\n Best method of contact: $check_msg\n Best Time to Contact: $ctime\n";
mail($to, $subject, $body);
header("location: http://www.domain.com/thankyou.html");
die;
} else {
header("location:http://www.domain.com/error.html");
die;
}
?>
any ideas what i fugged up?
here is my code
<?php
if(isset($_POST['submit'])) {
$to = "email@email.com";
$subject = "contact";
$name_field = $_POST['posName'];
$title_field = $_POST['posTitle'];
$company_field = $_POST['posComp'];
$addy_field = $_POST['posAddy'];
$phone_field = $_POST['posPhone'];
$email_field = $_POST['posEmail'];
$web_field = $_POST['posWeb'];
$message = $_POST['message'];
$desc = $_POST['describe'];
$other = $_POST['other'];
$ctime = $_POST['posTime'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
foreach($_POST['contact'] as $value2) {
$check_msg2 .= "Checked: $value2\n";
}
$body = "From: $name_field\n Title: $title_field\n Comapny: $company_field\n Address: $addy_field\n Phone: $phone_field\n E-Mail: $email_field\n Website: $web_field\n Request Reason: $check_msg\n Answer for Do you have a carpet question: $desc\n Answer when client chose Other: $other\n Best method of contact: $check_msg\n Best Time to Contact: $ctime\n";
mail($to, $subject, $body);
header("location: http://www.domain.com/thankyou.html");
die;
} else {
header("location:http://www.domain.com/error.html");
die;
}
?>
any ideas what i fugged up?