title: PHP Code for a large HTML Order Form to submit data to an email address
body: <p>I have a large order form in html,and I want to be able to email the data to an email address. I have the below PHP script to send it, but it keeps going to a blank white screen or errors. Can anyone help me find what I am missing or need to change.</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['email'])) {
  
      // EDIT THE 2 LINES BELOW AS REQUIRED
      $email_to = "myemail@gmail.com";
      $email_subject = "Dealer Order";
  
  
       $midnight = $_POST['midnight'];
       $midFiveSqFt = $_POST['midFiveSqFt'];
       $midThreeSqFt = $_POST['midThreeSqFt'];
       $midTotalSqFt = $_POST['midTotalSqFt'];
       $midPrice = $_POST['midPrice'];
           $midLineTotal = $_POST['midLineTotal'];
  
          $daynight = $_POST['daylight'];
      $dayFiveSqFt = $_POST['dayFiveSqFt'];
      $dayThreeSqFt = $_POST['dayThreeSqFt'];
      $dayTotalSqFt = $_POST['dayTotalSqFt'];
      $dayPrice = $_POST['dayPrice'];
      $dayLineTotal = $_POST['dayLineTotal'];
  
      $earthtone = $_POST['earthtone'];
      $earthFiveSqFt = $_POST['earthFiveSqFt'];
      $earthThreeSqFt = $_POST['earthThreeSqFt'];
      $earthTotalSqFt = $_POST['earthTotalSqFt'];
      $earthPrice = $_POST['earthPrice'];
      $earthLineTotal = $_POST['earthLineTotal'];
  
      $mixedBlend = $_POST['mixedBlend'];
      $mbFiveSqFt = $_POST['mbFiveSqFt'];
      $mbThreeSqFt = $_POST['mbThreeSqFt'];
      $mbTotalSqFt = $_POST['mbTotalSqFt'];
      $mbPrice = $_POST['mbPrice'];
      $mbLineTotal = $_POST['mbLineTotal'];
  
      $starryNight = $_POST['starryNight'];
      $snTotalSqFt = $_POST['snTotalSqFt'];
      $snPrice = $_POST['snPrice'];
      $snLineTotal = $_POST['snLineTotal'];
  
      $dayNight = $_POST['dayNight'];
      $dnTotalSqFt = $_POST['dnTotalSqFt'];
      $dnPrice = $_POST['dnPrice'];
      $dnLineTotal = $_POST['dnLineTotal'];
  
      $caramelstone = $_POST['caramelstone'];
      $carTotalSqFt = $_POST['carTotalSqFt'];
      $carPrice = $_POST['carPrice'];
      $carLineTotal = $_POST['carLineTotal'];
  
      $harvestBlend = $_POST['harvestBlend'];
      $hbTotalSqFt = $_POST['hbTotalSqFt'];
      $hbPrice = $_POST['hbPrice'];
      $hbLineTotal = $_POST['hbLineTotal'];
  
      $winterBlend = $_POST['winterBlend'];
      $wbTotalSqFt = $_POST['wbTotalSqFt'];
      $wbPrice = $_POST['wbPrice'];
      $wbLineTotal = $_POST['wbLineTotal'];
  
      $autumnBlend = $_POST['autumnBlend'];
      $abTotalSqFt = $_POST['abTotalSqFt'];
      $abPrice = $_POST['abPrice'];
      $abLineTotal = $_POST['abLineTotal'];
  
      $tiletotal = $_POST['tiletotal'];
      $tiledel = $_POST['tiledel'];
  
      $oneWick = $_POST['oneWick'];
      $owPrice = $_POST['owPrice'];
      $owLineTotal = $_POST['owLineTotal'];
  
      $twoWick = $_POST['twoWick'];
      $twPrice = $_POST['twPrice'];
      $twLineTotal = $_POST['twLineTotal'];
  
      $threeWick = $_POST['threeWick'];
      $thwPrice = $_POST['thwPrice'];
      $thwLineTotal = $_POST['thwLineTotal'];
  
      $sixx8tray = $_POST['sixx8tray'];
      $sixtryPrice = $_POST['sixtryPrice'];
      $sixtryLineTotal = $_POST['sixtryLineTotal'];
  
      $sevenx10tray = $_POST['sevenx10tray'];
      $svntryPrice = $_POST['svntryPrice'];
      $svntryLineTotal = $_POST['svntryLineTotal'];
  
      $silverStopper = $_POST['silverStopper'];
      $ssPrice = $_POST['ssPrice'];
      $ssLineTotal = $_POST['ssLineTotal'];
  
      $knife = $_POST['knife'];
      $kPrice = $_POST['kPrice'];
      $kLineTotal = $_POST['kLineTotal'];
  
      $spectotal = $_POST['spectotal'];
      $specdel = $_POST['specdel'];
  
      $over150_1 = $_POST['over150_1'];
  
      $grandtot = $_POST['grandtot'];
  
      $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 .= "Midnight: ".clean_string($midnight)."\n";
      $email_message .= "midFiveSqFt: ".clean_string($midFiveSqFt)."\n";
      $email_message .= "midThreeSqFt: ".clean_string($midThreeSqFt)."\n";
      $email_message .= "midTotalSqFt: ".clean_string($midTotalSqFt)."\n";
      $email_message .= "midPrice: ".clean_string($midPrice)."\n";
      $email_message .= "midLineTotal: ".clean_string($midLineTotal)."\n";
  
  **(I know I need to finish the above for all the types)**
  
  
  // create email headers
  $headers = 'From: '.$email."\r\n".
  'Reply-To: '.$email."\r\n" .
  'X-Mailer: PHP/' . phpversion();
  @mail($email_to, $email_subject, $email_message, $headers);  
  
  }
  ?&gt;
  </code></pre>