title: Html contact form and php
body: <p>I'm going to post my html form and my php and hopefully someone can help me make them actually work. My agenda is to make what the user inputs into the html be sent to my email, and also for them to receive an email back saying that we got their email.</p>
  
  <p>I also wanted for the user to be send to a "thank you we got your email" page after hitting submit. The html is kind of long so forgive me for that.</p>
  
  <pre><code>    &lt;!-- contact ---&gt;
  
  &lt;div class="templatemo_caption"&gt;
       &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;p&gt;Create any task you would like.&lt;/p&gt;
                  &lt;div class="clear"&gt;
                      &lt;/div&gt;
                      &lt;div align="center"&gt;
       &lt;div class="container"&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-md-3"&gt;
            &lt;form action="sendmail.php" method="POST"&gt;
          &lt;form role="form"&gt;
            &lt;div class="form-group"&gt;
  
              &lt;input name="name" type="text" class="form-control" id="name"   placeholder="Your Name" maxlength="30"&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
               &lt;input name="email" type="text" class="form-control" id="email"       placeholder="Your Email" maxlength="30"&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
              &lt;input name="subject" type="text" class="form-control"        id="subject" placeholder="Your Task" maxlength="40"&gt;
            &lt;/div&gt;
                &lt;br /&gt;&amp;nbsp;&lt;br /&gt;
            &lt;input type="submit" value="Send Feedback" /&gt;
  
  
  
        &lt;/div&gt;
        &lt;div class="col-md-9"&gt;
          &lt;div class="txtarea"&gt;
            &lt;textarea name="subject" rows="10" class="form-control" id="subject"&gt; Any specific details we need to know?&lt;/textarea&gt;
          &lt;/div&gt;
  
  
  
            &lt;/form&gt;
             &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;!--Contact End--&gt;
  </code></pre>
  
  <p>AND THE PHP LOOKS LIKE THIS</p>
  
  <pre><code>&lt;?php
  
  /* Subject and email variables */
  
  $emailsSubject = 'This is where you type what you subject will show up as';
  $webMaster  = 'chelsieoverbay@yahoo.com';
  
  
  /* Gathering Data Variables - Whats in the form */
  
  $name = $_POST ['name'];
  $email = $_POST ['email'];
  $subject = $_POST ['subject'];
  $msg = $_POST['msg'];
  
  
  /*Security*/
  
  
  
  
  /* What You Want To See In The Email Place Inbetween $body = &lt;&lt;&lt;EOD  and      EOD; */    
  $body = &lt;&lt;&lt;EOD
  
  &lt;strong&gt;Client:&lt;/strong&gt; $name
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;strong&gt;Email:&lt;/strong&gt; $email
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;strong&gt;Subject:&lt;/strong&gt; $subject
  &lt;br /&gt;
  &lt;br /&gt;
  ______________________________________________
     &lt;br /&gt;
     &lt;br /&gt;
     $msg
  
     EOD;
  
     /* Headers is a tag containing the users email and how you want it to display in your email */
  
    $headers = "From: $email\r\n";
   $headers .= "Content-type: text/html\r\n";
  
  /* This is what sends the email */
  $success = mail($webMaster, $emailsSubject, $body, $headers);
  
  /* Results Rendered as Html */
  echo file_get_contents("studenthome.nku.edu/~overbayc1/onlinebutler/submit.html");
  
  ?&gt;
  </code></pre>