Broken code in company contact form : <p>The contact form on my employer's website doesn't work so they asked me to fix it. I examined the code and found some issues. The "form method" was incorrect so I changed that. Also, the email address in the send_form_email.php was wrong so I fixed that as well but the form still doesn't work. Can anybody see what I'm missing here?</p>

<pre><code>    &lt;form action="send_form_email.php" method="post" class="fieldbox2"&gt;
      &lt;table width="344" border="0" cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td width="169" align="right" valign="middle"&gt;&lt;span class="fieldbox1"&gt;
            &lt;input name="first_name" type="text" id="first_name" value="First Name"/&gt;
          &lt;/span&gt;&lt;/td&gt;
          &lt;td width="7" align="right" valign="middle"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;td width="168" align="left" valign="middle"&gt;&lt;span class="fieldbox1"&gt;
            &lt;input name="last_name" type="text" id="last_name" value="Last Name"/&gt;
          &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td align="right" valign="middle"&gt;&lt;span class="fieldbox1"&gt;
            &lt;input name="email" type="text" id="email" value="Email"/&gt;
          &lt;/span&gt;&lt;/td&gt;
          &lt;td align="right" valign="middle"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;td align="left" valign="middle"&gt;&lt;span class="fieldbox1"&gt;
            &lt;input name="city" type="text"  id="city" value="City"/&gt;
          &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td align="right" valign="middle"&gt;&lt;span class="fieldbox1"&gt;
            &lt;input name="telephone" type="text"  id="telephone" value="Phone Number"/&gt;
          &lt;/span&gt;&lt;/td&gt;
          &lt;td align="right" valign="middle"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;td align="left" valign="middle"&gt;&lt;span class="fieldbox1"&gt;
            &lt;input name="company" type="text"  id="company" value="Company"/&gt;
          &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="3" align="center" valign="middle"&gt;&lt;textarea name="textarea2" cols="45" id="textarea2"&gt;Write Comments&lt;/textarea&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="3" align="center" valign="middle"&gt;&lt;p&gt;
            &lt;input name="sendbutton" type="button" id="sendbutton" value="Submit Query"/&gt;
          &lt;/p&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/form&gt;

&lt;?php
if(isset($_POST['email'])) {


    $email_to = "#";
    $email_subject = "Quote Requested";


    function died($error) {

        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.&lt;br /&gt;&lt;br /&gt;";
        echo $error."&lt;br /&gt;&lt;br /&gt;";
        echo "Please go back and fix these errors.&lt;br /&gt;&lt;br /&gt;";
        die();
    }


    if(!isset($_POST['first_name']) ||
        !isset($_POST['last_name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['city']) ||
        !isset($_POST['telephone']) ||
        !isset($_POST['company']) ||
        !isset($_POST['comments'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');      
    }

    $first_name = $_POST['first_name']; // required
    $last_name = $_POST['last_name']; // required
    $email_from = $_POST['email']; // required
    $city = $_POST['city']; // required
    $telephone = $_POST['phone_number']; // not required
    $company = $_POST['company']; // not required
    $comments = $_POST['comments']; // required

    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.&lt;br /&gt;';
  }
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$first_name)) {
    $error_message .= 'The First Name you entered does not appear to be valid.&lt;br /&gt;';
  }
  if(!preg_match($string_exp,$last_name)) {
    $error_message .= 'The Last Name you entered does not appear to be valid.&lt;br /&gt;';
  }
  if(!preg_match($string_exp,$city)) {
    $error_message .= 'The City you entered does not appear to be valid.&lt;br /&gt;';
  }
  if(strlen($comments) &lt; 2) {
    $error_message .= 'The Comments you entered do not appear to be valid.&lt;br /&gt;';
  }
  if(strlen($error_message) &gt; 0) {
    died($error_message);
  }
    $email_message = "Form details below.\n\n";

    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    }

    $email_message .= "First Name: ".clean_string($first_name)."\n";
    $email_message .= "Last Name: ".clean_string($last_name)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Telephone: ".clean_string($telephone)."\n";
    $email_message .= "Company: ".clean_string($company)."\n";
    $email_message .= "Comments: ".clean_string($comments)."\n";



$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers); 
?&gt;


Thank you for contacting us. We will be in touch with you very soon.
&lt;?php

}

?&gt;
</code></pre>
