title: HTML/PHP Form sending emails with blank fields
body: <p>I have written a contact form in Dreamweaver and embedded it in Adobe Muse. Problem is that the form sends an email OK, but with blank fields, just the headings. It's probably a problem with my code, as I'm a relative noob with HTML and even more so with PHP. The PHP script was originally downloaded from 123reg, as that is where the website is hosted. Obvs I've tweaked it to suit. I've looked at other posts with similar problems but nothing has worked.`
  The form seems to work ok, so maybe I can start with the PHP.</p>
  
  <pre><code>    &lt;?php
  
  $EmailFrom = "sales@trisomet.com";
  $EmailTo = "sales@hairwraps.co.uk";
  $Subject = "QuikQuote Web Enquiry";
  $name = trim(stripslashes($_POST['Name']));
  $email = trim(stripslashes($_POST['Email']));
  $tel = trim(stripslashes($_POST['Tel']));
  $textfield2 = trim(stripslashes($_POST['Postcode']));
  $textarea = trim(stripslashes($_POST['Message']));
  $RoofType = trim(stripslashes($_POST['Roof Type']));
  $number = trim(stripslashes($_POST['Roof Length']));
  $number2 = trim(stripslashes($_POST['Roof Width']));
  $RadioGroup1 = trim(stripslashes($_POST['Fixings']));
  $Flashing = Trim(stripslashes($_POST['Flashings']));
  $panels = trim(stripslashes($_POST['Clear Panels']));
  $number3 = trim(stripslashes($_POST['Quantity']));
  $number4 = trim(stripslashes($_POST['Length']));
  
  // validation
  $validationOK=true;
  if (!$validationOK) {
    print "&lt;meta http-equiv=\"refresh\" content=\"0;URL=error.htm\"&gt;";
    exit;
  }
  
  // prepare email body text
  
  $Body = "";
  $Body .= "Name: ";
  $Body .= $name;
  $Body .= "\n";
  $Body .= "Email: ";
  $Body .= $email;
  $Body .= "\n";
  $Body .= "Tel: ";
  $Body .= $tel;
  $Body .= "\n";
  $Body .= "Postcode: ";
  $Body .= $textfield2;
  $Body .= "\n";
  $Body .= "Message: ";
  $Body .= $textarea;
  $Body .= "\n";
  $Body .= "Roof Type: ";
  $Body .= $RoofType;
  $Body .= "\n";
  $Body .= "Roof Length: ";
  $Body .= $number;
  $Body .= "\n";
  $Body .= "Roof Width: ";
  $Body .= $number2;
  $Body .= "\n";
  $Body .= "Fixings: ";
  $Body .= $RadioGroup1;
  $Body .= "\n";
  $Body .= "Flashing: ";
  $Body .= $Flashing;
  $Body .= "\n";
  $Body .= "Clear Panels: ";
  $Body .= $panels;
  $Body .= "\n";
  $Body .= "Quantity: ";
  $Body .= $number3;
  $Body .= "\n";
  $Body .= "Length (m): ";
  $Body .= $number4;
  $Body .= "\n";
  
  // send email
  $success = mail($EmailTo, $Subject, $Body, "From: $EmailFrom");
  
  // redirect to success page
  if ($success){
    print "&lt;meta http-equiv=\"refresh\" content=\"1;URL=index.html\"&gt;";
  }
  else{
    print "&lt;meta http-equiv=\"refresh\" content=\"1;URL=error.html\"&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>Does anything look obviously wrong?
  I think my HTML declaration is ok -</p>
  
  <pre><code> &lt;form action="contactform.php" method="post" class="form"&gt;
  </code></pre>
  
  <p>Any help would be fantastic as it's doing my nut in!!</p>
  
  <p>here's the html</p>
  
  <pre><code> &lt;div id="formWrapper"&gt;
    &lt;form action="contactform.php" method="post" class="form"&gt;
    &lt;div class="container" style="width: 100%; "&gt;
      &lt;div class="sidebar" style="width: 365px; height:255px; margin-left:10px; float: left; "&gt;
          &lt;label for="textfield"&gt;&lt;strong&gt;Name&lt;/strong&gt;:&lt;/label&gt;
      &lt;input name="textfield" type="text" required id="textfield" size="40"&gt;
    &lt;/p&gt;&lt;br&gt;
    &lt;p&gt;
      &lt;label for="email"&gt;&lt;strong&gt;Email:&lt;/strong&gt;&lt;/label&gt;
      &lt;input name="email" type="email" required id="email" size="40"&gt;
    &lt;/p&gt;&lt;br&gt;
    &lt;p&gt;
      &lt;label for="tel"&gt;&lt;strong&gt;Telephone: &lt;/strong&gt;&lt;/label&gt;
          &lt;input name="tel" type="tel" required id="tel" size="40"&gt;
            &lt;/p&gt;&lt;br&gt;&lt;p&gt;
    &lt;label for="textfield2"&gt;&lt;strong&gt;Postcode:&lt;/strong&gt;&lt;/label&gt;
    &lt;input name="textfield2" type="text" required id="textfield2"&gt;
            &lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="content" style="width:365px; height: 255px; float:right; margin-right:10px;"&gt;
           &lt;label for="textarea"&gt;&lt;strong&gt;Message:&lt;/strong&gt;&lt;/label&gt;
      &lt;strong&gt;
      &lt;textarea name="textarea" rows="13" cols="40"&gt;&lt;/textarea&gt;
      &lt;/strong&gt;&lt;/p&gt;
      &lt;/div&gt;
  
    &lt;/div&gt;
    &lt;div class="content3" style="width: 220px; height:110px; margin-left:10px; float: left;"&gt;
          &lt;label for="Roof Type"&gt;&lt;strong&gt;Roof Type: &lt;/label&gt;
        &lt;/strong&gt;
  
        &lt;label&gt;
          &lt;input name="Roof Type" type="radio" required id="RoofType_0" title="Roof Type" value="Single Slope"&gt;
          Single Slope&lt;/label&gt;
        &lt;label&gt;
          &lt;input type="radio" name="Roof Type" value="Symmetrical Apex" id="RoofType_1"&gt;
          Symmetrical Apex&lt;/label&gt;
        &lt;label&gt;
          &lt;input type="radio" name="Roof Type" value="Asymmetrical Apex" id="RoofType_2"&gt;
          Asymmetrical Apex&lt;/label&gt;
  
    &lt;/div&gt;
    &lt;div class="content4" style="width: 215px; height: 110px; float:left; "&gt;
    &lt;label for="number"&gt;&lt;strong&gt;Roof Length (m):&lt;/strong&gt;&lt;/label&gt;
      &lt;input name="number" type="number" required id="number"&gt;
      &lt;label for="number2"&gt;&lt;strong&gt;Roof Width (m):&lt;/strong&gt;&lt;/label&gt;
      &lt;input name="number2" type="number" required id="number2"&gt;
    &lt;/div&gt;
    &lt;div class="content5" style="width:210px; height: 110px; float:left; "&gt;
    &lt;label&gt;&lt;strong&gt;Fixings:&lt;/strong&gt;&lt;br&gt;
  
        &lt;input name="RadioGroup1" type="radio" required id="RadioGroup1_0" value="Timber"&gt;
  Timber&lt;/label&gt;
  
      &lt;label&gt;
        &lt;input type="radio" name="RadioGroup1" value="Light Section Steel" id="RadioGroup1_1"&gt;
        Light Section Steel&lt;/label&gt;
  
      &lt;label&gt;
        &lt;input type="radio" name="RadioGroup1" value="Heavy Section Steel" id="RadioGroup1_2"&gt;
        Heavy Section Steel&lt;/label&gt;
    &lt;/div&gt;
    &lt;div class="content6" style="width:85px; height: 110px;float:left; "&gt;
    &lt;strong&gt;Flashing:
  &lt;/strong&gt;
      &lt;label&gt;
        &lt;input name="Flashing" type="radio" required id="Flashing_0" value="Yes"&gt;
        Yes&lt;/label&gt;
      &lt;label&gt;
        &lt;input type="radio" name="Flashing" value="No" id="Flashing_1"&gt;
      No&lt;/label&gt;
  
    &lt;/div&gt;
    &lt;div class="content7" style="width:150px; margin-left: 10px; height: 90px; float:left; "&gt;
    &lt;label for "panels" style="font-weight:bold"&gt;Clear Panels:&lt;/strong&gt;&lt;/label&gt;
      &lt;label&gt;
        &lt;input name="panels" type="radio" required id="panels_0" value="Yes"&gt;
        Yes&lt;/label&gt;
      &lt;label&gt;
        &lt;input type="radio" name="panels" value="No" id="panels_1"&gt;
        No&lt;/label&gt;
  
    &lt;/div&gt;
  
    &lt;div class="content8" style="width:100px; height: 110px; float:left;"&gt;
  &lt;label for="number3"&gt;&lt;strong&gt;Quantity:&lt;/strong&gt;&lt;/label&gt;
    &lt;input name="number3" type="number" required id="number3" style="width:80px" value="0"&gt;
    &lt;/div&gt;
    &lt;div class="content9" style="width:150px; height:110px;float:left;"&gt;
    &lt;label for="number4"&gt;&lt;strong&gt;Length (m):&lt;/label&gt;
    &lt;input name="number4" type="number" required id="number4" style="width:80px" value="0"&gt;
    &lt;/div&gt;
   &lt;div class="submitb" style="width:190px; height:110px; float:left; "&gt;
   &lt;p&gt;
   &lt;input type="submit" name="submit" id="submit" value="Get A Quote &gt;"&gt;
   &lt;/p&gt;
   &lt;/div&gt;
  
  
  &lt;/form&gt;&lt;/div&gt;
  </code></pre>