Hi, I have created a questionaire form on my site and I had my php script working and for some odd reason, I am now receiving the following error message when you click submit.
"The server encountered an unexpected condition which prevented it from fulfilling the request."
The form can be found at Website Quote Form . It is linking to a php file with the below script. I checked the form on my Contact Us page and it works fine and is using the same script, only simpler. Any ideas?
Nonworking PHP Script for Questionnaire Form
<?php
$email = $_POST["email"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$headers = "From: " . $_POST["email"];
$question1 = $_POST["question1"];
$question2 = $_POST["question2"];
$question3 = $_POST["question3"];
$question4 = $_POST["question4"];
$question5 = $_POST["question5"];
$question6 = $_POST["question6"];
$comments = $_POST["comments"];
$name = $_POST["name"];
$subject = "Website Questionnaire via SOLE Productions Website"; // your webpage
$time = date("l d F Y @ H:i");
$to = "michael@soleproductions.com"; // your email
$message2 = "\nName: " . $name . "\nAddress: " . $address . "\nCity: " . $city . "\nState: " . $state ."\nZip: " . $zip . "\nEmail: " . $email .
"\n1. What do you want the purpose of your website to be?: " . $question1 . "\n2. What pages do you want and what will be each page's purpose? : " . $question2 . "\n3. Are there any particular items that you want to have on your website?: " . $question3 . "\n4. Do you have your own logos & graphics or will these need to be created?: " . $question4 . "\n5. List 3 websites that you like and what you like about them.: " . $question5 . "\n6. What is the name of your company/organization?: " . $question6 . "\nComments: " . $comments ;
if ($email) {
if (mail($to, $subject, $message2, $headers)) {
Header("Location: [url]http://www.soleproductions.com/thankyou.html[/url]");
}
else {
print("The server encountered an unexpected condition which prevented it from fulfilling the request.");
}
}
else {
print("Please fill out all fields.");
}
?>
Working Script for Contact Us Form
<?php
$email = $_POST["email"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$headers = "From: " . $_POST["email"];
$comments = $_POST["comments"];
$name = $_POST["name"];
$subject = "Contact Us via SOLE Productions Website"; // your webpage
$time = date("l d F Y @ H:i");
$to = "mail@soleproductions.com"; // your email
$message2 = "\nName: " . $name . "\nAddress: " . $address . "\nCity: " . $city . "\nState: " . $state ."\nZip: " . $zip . "\nEmail: " . $email . "\nComments: " . $comments ;
if ($email) {
if (mail($to, $subject, $message2, $headers)) {
Header("Location: [url]http://www.soleproductions.com/thankyou.html[/url]");
}
else {
print("The server encountered an unexpected condition which prevented it from fulfilling the request.");
}
}
else {
print("Please fill out Name & Email before submitting. Click Back to return to form");
}
?>